Controlling your window

In NovaOS, apps are provided with an object to let the manage themselves. For example, closing your app window or changing to title in the window navigation bar.

Developers can use the myWindow object to handle these. The myWindow object is injected to all application windows and can be accessed within a greenflag function.

circle-exclamation

Using myWindow

Here is an example script to close the current application.

function closeApp() {
  myWindow.close();
}

Here is an example script to return the IDs of your app.

function whatIsMyFileId() {
  return myWindow.appID; // returns the ID of the source file
}

function whatIsMyWindowId() {
  return myWindow.windowID; // returns the ID of the current window
}

myWindow is also used under OLP for initiating your app as a handler, learn how.

Last updated