NovaOS
GithubHomeLaunchNeed help?
  • Welcome to NovaOSđź‘‹
  • Get started
    • Access NovaOS
  • How to
    • NovaOS How To
      • Setting a custom wallpaper
      • Changing default openers
      • Using default apps
        • Nova Files App
      • Data recovery
      • Using the Tasks Dock
    • Publish to Nova Store
    • Protips
    • Feedback and suggest
    • Support NovaOS
  • docs
    • Basics
      • Introduction
      • Timing
      • File system
        • Overview on files
        • File management
      • User choices
        • Settings Keys
        • Choose files
      • Managing self
        • The Open Launch Protocol
        • The EventBusWorker
    • Standards
      • Styling standards
      • Error standards
    • Networking
      • Rotur In NovaOS
    • Features
  • References
    • The NovaOS Check list
    • Methods
      • Database management
      • File management
    • NTX Actions
    • Projects
  • Epic
    • Achievements
Powered by GitBook
On this page

Was this helpful?

  1. docs
  2. Basics

Managing self

PreviousChoose filesNextThe Open Launch Protocol

Last updated 5 months ago

Was this helpful?

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 .

An application cannot run scripts without an opened window in NovaOS2. Be sure to save important data while closing your application by itself.

It is highly unrecommended to block the user from managing aspects of your application.

Using myWindow

Here is an example script to close the current application.

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

Here is an example script to change the current application title in the app navigation bar.

function changeTitle() {
  myWindow.titleElement.innerText = "My New App Title";
}

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 whatIsMyFileId() {
  return myWindow.windowID; // returns the ID of the current window
}
greenflag function