Constructor
new Window(configopt)
Creates a window object.
Example:
// Create a new window:
let newWindow = new windowmanager.Window({
url: "child.html", // Loads "child.html" based on the current window's url.
width: 500,
height: 500
});
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object
|
<optional> |
Window Configuration
|
Extends
Methods
(static) getAll() → {Array.<Window>}
Returns a list of all Window instances open.
Example:
// Close all windows:
let allWindows = windowmanager.Window.getAll();
Returns:
- Type:
-
Array.<Window>
(static) getByID(id) → {Window|undefined}
Returns the Window instance that has id
.
Example:
// Get window with ID:
let window = windowmanager.Window.getById(windowID);
Parameters:
Name | Type | Description |
---|---|---|
id |
String
|
Number
|
Returns:
- Type:
-
Window
|undefined
(static) getCurrent() → {Window}
Returns the Window instance that calls this function.
Example:
// Get current window this code is executing in:
let currentWindow = windowmanager.Window.getCurrent();
Returns:
- Type:
-
Window
(static) getMain() → {Window}
Returns the Window instance that is the main window.
Example:
// Get main window of the application:
let mainWindow = windowmanager.Window.getMain();
Returns:
- Type:
-
Window
bringToFront(callbackopt)
Brings the window instance to the front of all windows.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
clearEvent(eventNames)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
eventNames |
String
|
close(callbackopt)
Closes the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
dock(other)
Force docking this window to another. They don't need to be touching.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
other |
Window
|
||
|
Callback
|
<optional> |
emit(eventName, …args) → {Boolean}
- Inherited From:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
eventName |
String
|
||
args |
*
|
<repeatable> |
Arguments to pass to listeners |
Returns:
- Type:
-
Boolean
true if all handlers return true, else false
focus(callbackopt)
Sets focus to the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
getHeight() → {Number}
Returns window's height.
Returns:
- Type:
-
Number
getTitle() → {String}
Returns window's title.
Returns:
- Type:
-
String
getWidth() → {Number}
Returns window's width.
Returns:
- Type:
-
Number
hide(callbackopt)
Hides the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
isClosed() → {Boolean}
Returns whether window has been closed already.
Returns:
- Type:
-
Boolean
isHidden() → {Boolean}
Returns true if window is hidden.
Returns:
- Type:
-
Boolean
isMaximized() → {Boolean}
Returns true if window is maximized.
Returns:
- Type:
-
Boolean
isMinimized() → {Boolean}
Returns true if window is minimized.
Returns:
- Type:
-
Boolean
isReady() → {Boolean}
Returns true if the Window instance is created, not closed, and ready for method calls.
Returns:
- Type:
-
Boolean
isResizable() → {Boolean}
Returns true if window is not hidden or minimize or maximized.
Returns:
- Type:
-
Boolean
isRestored() → {Boolean}
Returns true if window is not hidden or minimize or maximized.
Returns:
- Type:
-
Boolean
isShown() → {Boolean}
Returns true if window is not hidden.
Returns:
- Type:
-
Boolean
maximize(callbackopt)
Maximizes the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
minimize(callbackopt)
Minimizes the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
moveBy(deltaLeft, deltaTop, callbackopt)
Moves the window instance relative to its current position.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
deltaLeft |
Number
|
||
deltaTop |
Number
|
||
callback |
Callback
|
<optional> |
moveTo(left, top, callbackopt)
Moves the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left |
Number
|
||
top |
Number
|
||
callback |
Callback
|
<optional> |
off(eventNames, eventListener)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
eventNames |
String
|
|
eventListener |
callback
|
on(eventNames, eventListener)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
eventNames |
String
|
|
eventListener |
callback
|
once(eventName, eventListener)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
eventName |
String
|
|
eventListener |
callback
|
onReady(callbackopt)
Calls a callback when window is ready and setup.
Example:
newWindow.onReady(() => {
// newWindow methods can be executed in here
});
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
removePipe(eventHandler)
- Inherited From:
Parameters:
Name | Type | Description |
---|---|---|
eventHandler |
EventHandler
|
resizable(resizable, callbackopt)
Sets whether the window instance is resizable.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
resizable |
Boolean
|
||
callback |
Callback
|
<optional> |
resizeTo(width, height, callbackopt)
Resizes the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
width |
Number
|
||
height |
Number
|
||
callback |
Callback
|
<optional> |
restore(callbackopt)
Restores the window instance from the minimized or maximized states.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |
setBounds(left, top, right, bottom, callbackopt)
Sets the bounds of the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left |
Number
|
||
top |
Number
|
||
right |
Number
|
||
bottom |
Number
|
||
callback |
Callback
|
<optional> |
setTitle(title)
Sets window's title.
Parameters:
Name | Type | Description |
---|---|---|
title |
String
|
show(callbackopt)
Unhides the window instance.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
Callback
|
<optional> |