Windows

Windows are different views that may be displayed to the user. They include the main window, named root, which displays the world and model viewer, as well as various popup, modal, and input windows. These include the Object Editor, Import Manager, and dialogs which accept user input.

Windows are registered using a .json file in the /windows directory. The structure of this file follows:

Window manifest file (.json)
{
    *name:                <String>
    *path:                <String>
    description:          <String>
    *width:               <Int>
    *height:              <Int>
    parent:               <String>
    modal:                <Bool>
    frame:                <Bool>
    resizable:            <Bool>
    allowMultiple:        <Bool>
    requiresTemplate:     <Bool>
}

(*) = required

When the application launches, it reads in each .json file located in the /windows directory. The name is used to reference a specific window.

Class

The Window class offers methods to facilitate working with windows. Its core functionality is described below.

Members

openWindows

A list of windows that are currently open, with the key being the name of the window, and the value being an Electron BrowserWindow.

availableWindows

A list of all windows that have been registered with the class. The key is the window name, and the value is the window manifest (.json file).

Methods

Open(windowName[, template, events])

Opens the specified window with the given template object and events. If the target window has the allowMultiple flag set to false and the target window is already open, this method brings that window to focus.

Close(windowName)

Closes the specified window, if it is open. Otherwise, does nothing.

SendMessage(windowName, eventName[, data])

Signals an event to the target window, passing along data.

Broadcast(eventName[, data])

Broadcasts the specified event and data to all open windows.

results matching ""

    No results matching ""