Tutorial: window.constructor

window.constructor

A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window.

Options Object

alwaysOnTop

A flag to always position the window at the top of the window stack. Default: false

autoShow

A flag to automatically show the Window when it is created. Default: false.

contextMenu

A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true

cornerRounding

This defines and applies rounded corners for the window. Default for both width and height: 0

cornerRounding: {
    width: 25,
    height: 30
}
defaultCentered

Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the position from before the window was closed is used.

defaultHeight

The default height of the window. Specifies the height of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed.

defaultLeft

The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed.

defaultTop

The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed.

defaultWidth

The default width of the window. Specifies the width of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed.

frame

A flag to show the frame. Default: true

hideOnClose

A flag to allow a window to be hidden when the close button is clicked. Default: false

icon

A url for the icon to be shown in the window title bar

maxHeight

The maximum height of a window. Will default to the OS defined value if set to -1. Default: -1

maximizable

A flag that lets the window be maximized. Default: true

maxWidth

The maximum width of a window. Will default to the OS defined value if set to -1. Default: -1

minHeight

The minimum height of a window. Default: 0

minimizable

A flag that lets the window be minimized. Default: true

minWidth

The minimum width of a window. Default: 0

name

The name for the window which must be unique within the context of the invoking Application.

opacity

A flag that specifies how transparent the window will be. This value is clamped between 0.0 and 1.0. Default: 1.0

resizable

A flag to drop to allow the user to resize the window. Default: true

resizeRegion

Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window.

resizeRegion: {
    size: 2, //The size in pixels (Default: 2),
    bottomRightCorner: 4 //The size in pixels of an additional 
                         //square resizable region located at the 
                         //bottom right corner of a 
                         //frameless window. (Default: 4)
    }
showTaskbarIcon

A flag to show the Window's icon in the taskbar. Default: true

saveWindowState

A flag to cache the location of the window or not. Default: true

taskbarIcon

The URL of an icon to be shown on the desktop. Support formats: Portable Network Graphic (PNG); Size: 256 x 256 Default: The parent application's applicationIcon

state

A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal"

url

The URL of the window. Default: "about:blank"

Example

var childWindow = new fin.desktop.Window({
    name: "childWindow",
    url: "child.html",
    defaultWidth: 320,
    defaultHeight: 320,
    defaultTop: 10,
    defaultLeft: 300,
    frame: false,
    resize: false,
    windowState: "normal",
    autoShow: true
}, function () {
    console.log("The window has successfully been created");
}, function () {
    console.log("Error creating window");
});