Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • NW.js Essentials
  • Toc
  • feedback
NW.js Essentials

NW.js Essentials

By : Benoit
4.8 (5)
close
NW.js Essentials

NW.js Essentials

4.8 (5)
By: Benoit

Overview of this book

If you are an experienced Node.js developer who wants to create amazing desktop applications using NW.js, this is the book for you. Prior knowledge of HTML5, jQuery, and CSS is assumed.
Table of Contents (11 chapters)
close
10
Index

The Window API – working with windows on NW.js


On NW.js, the Window API is nothing more than a wrapper of the DOM's window object giving an additional layer of functionality to play with the application windows. Many of the window methods described are inherited by the DOM window object. As we stated earlier, window is also an instance of Node.js EventEmitter giving you the ability to listen and respond to window events such as move or resize.

Instantiating a new window object

There are many ways to instantiate a window object. When you need to refer to the current window, all you have to do is to call the Window.get([window_object]) method leaving the attribute empty, as follows:

var gui = require('nw.gui');
var currentWindow = gui.Window.get();

In order to instantiate a different window object, you can proceed with passing the DOM window object to it through the get method:

var gui = require('nw.gui');
var extraWindow = gui.Window.get(
  window.open('window.html');
);

Otherwise, use the Window...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete