DOCS

Window

The wa.window object provides functionality to manage your current window.

Set Title

Use wa.window.setTitle(title) to set the window's title.

Change Dimensions

Use wa.window.setSize(width, height) to set width and height in one interaction and reduce re-layout of your html.

Set the dimensions of a window individually using wa.window.setHeight(pixels) and wa.window.setWidth(pixels).

The documentResized event is executed when the window is resized.

window.addEventListener("documentResized", function(event) {
	var o = event.data;
	console.log("Resized (" + o.width + ", " + o.height + ")");
});

Events

In addition to your DOM events an app running in DeskFrame can register a callback for special events.

The documentDeactivate event is executed when the window looses its focus.

window.addEventListener("documentDeactivate", function(event) {
	console.log("deactivate");
});

The documentActivate event is executed when the window gains focus.

window.addEventListener("documentActivate", function(event) {
	console.log("activated");
});

The documentClossing event is executed when the window closses (user closes the window or user quits the app).

window.addEventListener("documentClossing", function(event) {
	console.log("user is closing the window.");
	if( o.quitting ) console.log("user is closing the app.");
});

This event doesn't allow you to stop a quit or a window from closing. You can use wa.window.disableClose() and wa.window.enableClose() in parts of your code where you do not want the user to close your window.


Fork me on GitHub