Set loading background color of node-webkit window

9 views
Skip to first unread message

michalc...@gmail.com

unread,
Jan 5, 2014, 6:22:31 AM1/5/14
to node-...@googlegroups.com

In node-webkit, how can I set the background color of the window while the page is loading? It seems to always be white, but I would either like it to be transparent, or (in my case) a shade of green.

I've tried setting transparent: true in the window option of package.json, but it doesn't seem to have any effect.

(I have also asked this as a question on Stack Overflow at http://stackoverflow.com/questions/20925821/set-loading-background-color-of-node-webkit-window )

VoidVolker

unread,
Jan 6, 2014, 2:56:45 AM1/6/14
to node-...@googlegroups.com, michalc...@gmail.com
I use div with picture, start nw with option "window.show = false", after nw is strated I show the window "win.show()" and picture "programm loading", after page is loaded I hide this div.

Laszlo Z. Antal

unread,
Jan 6, 2014, 11:26:57 AM1/6/14
to node-...@googlegroups.com, node-...@googlegroups.com, michalc...@gmail.com
Hi

On Jan 5, 2014, at 11:56 PM, VoidVolker <voidv...@gmail.com> wrote:

I use div with picture, start nw with option "window.show = false", after nw is strated I show the window "win.show()" and picture "programm loading", after page is loaded I hide this div.

Was just about to reply. I do the same thing. I have the win.show in the bottom of my main html in a script tag to detect when everything is fully loaded. 

Laszlo
http://twitter.com/LZAntal

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

michalc...@gmail.com

unread,
Jan 6, 2014, 2:20:45 PM1/6/14
to node-...@googlegroups.com, michalc...@gmail.com
This almost gives what I want, but I still see a flash of white just before the content is rendered. Is there a way to avoid this?

Also, in kiosk mode (which is my main use case), on a mac, 

- The page fades to black
- Then the desktop appears again
- Then there is a quick flash of white
- Then my content appears

Is there a way to avoid this, and just go straight to showing the content?

LZAntal

unread,
Jan 6, 2014, 7:52:58 PM1/6/14
to node-...@googlegroups.com
Hi,


On Jan 6, 2014, at 11:20 AM, michalc...@gmail.com wrote:

This almost gives what I want, but I still see a flash of white just before the content is rendered. Is there a way to avoid this?

Also, in kiosk mode (which is my main use case), on a mac, 

- The page fades to black
- Then the desktop appears again
- Then there is a quick flash of white
- Then my content appears

Is there a way to avoid this, and just go straight to showing the content?


It sounds like you are calling win.show() too soon. When you say content do you mean a background image or all the elements on the page?
Try adding the div on top of all the content with a background color. After you call win.show you should only see that one div, add a setTimeout to hide in in a sec or less.

Hope it helps

Laszlo

VoidVolker

unread,
Jan 7, 2014, 4:05:00 AM1/7/14
to node-...@googlegroups.com, michalc...@gmail.com
Do you have ajax requests on page? I found the page render lag when loading synchronous ajax requests.

michalc...@gmail.com

unread,
Jan 11, 2014, 12:27:43 PM1/11/14
to node-...@googlegroups.com, michalc...@gmail.com


On Tuesday, January 7, 2014 9:05:00 AM UTC, VoidVolker wrote:
Do you have ajax requests on page? I found the page render lag when loading synchronous ajax requests.

No Ajax, even for Angular templates. An iframe is injected into the page that makes request(s), but only once the outer page has loaded.

Ejiroghene Gbenedio

unread,
Mar 12, 2014, 9:28:34 AM3/12/14
to node-...@googlegroups.com, michalc...@gmail.com


On Monday, 6 January 2014 08:56:45 UTC+1, VoidVolker wrote:
I use div with picture, start nw with option "window.show = false", after nw is strated I show the window "win.show()" and picture "programm loading", after page is loaded I hide this div.

Can you do me a priviledge by posting the codes? 
Message has been deleted

VoidVolker

unread,
Mar 12, 2014, 1:02:54 PM3/12/14
to node-...@googlegroups.com, michalc...@gmail.com

package.json:
{
    "main": "index.html",
    "window": {
        "show": false
    },
}

main.js:
var gui = require('nw.gui')
    , win = gui.Window.get()
;
$(function(){
    win.show();
});

среда, 12 марта 2014 г., 17:28:34 UTC+4 пользователь Ejiroghene Gbenedio написал:

ejiro gbenedio

unread,
Mar 13, 2014, 2:47:02 AM3/13/14
to node-...@googlegroups.com
Thank, really do appreciate!


Date: Wed, 12 Mar 2014 10:02:54 -0700
From: voidv...@gmail.com
To: node-...@googlegroups.com
CC: michalc...@gmail.com
Subject: [node-webkit] Re: Set loading background color of node-webkit window
--
You received this message because you are subscribed to a topic in the Google Groups "node-webkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-webkit/NxhJ4dO80Gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages