Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node-Webkit - Starting Maximized

I don't want a fullscreen application, but I would like to start a Node-Webkit application maximized. Can this be done? I am guessing its something to do with package.json, but can't seem to find what needs to be done.

like image 658
Rewind Avatar asked Aug 24 '13 22:08

Rewind


1 Answers

I don't think the manifest has an option to do that. Instead, call nw's Window.maximize() on startup. Something like:

// Load native UI library
var ngui = require('nw.gui');

// Get the current window
var nwin = ngui.Window.get();

Sometime later, in onload or some other point where you're ready to show the window:

onload = function() {
    nwin.show();
    nwin.maximize();
}

This is described in the node-webkit wiki. I don't think you can call maximize before showing the main window though (if it's hidden in manifest), but I haven't really dug into it.

You may want to consider saving the window position, from a UX standpoint. The wiki has an example for doing this.

like image 190
Mar Avatar answered Nov 04 '22 20:11

Mar