Window

Window class.

It is not possible to create an instance of this class. 'global.window' is already available.

center(x_pos=0, y_pos=0) (static)

Positions the window in the center.

Arguments:
x_pos (Integer)

X position

y_pos (Integer)

Y position

close() (static) Slow Method

Closes this window instance.

exec(cmd) (static) Slow Method

Executes a command in the background.

Arguments:
cmd (String)

The cmd with its arguments

notify(config) (static)

Send a notification to the systemtray.

Arguments:
config (Object)

Systemtray

icon (String)

Icon name

menu (Object[])

array of objects

id (Integer)

identifier

title (String)

name

openDirDialog(fn) (static) Slow Method

Opens a directory selection dialog.

Arguments:
fn (Function)

The callback function

list (String[])

List of the selected items

openFileDialog(types, fn) (static) Slow Method

Opens a file selection dialog.

Arguments:
types (String[])

list of allowed extensions or null

fn (Function)

The callback function

list (String[])

List of the selected items

openURL(url) (static) Slow Method

Open an url in a new browser session.

Arguments:
url (String)

The url to open

quit() (static) Slow Method

Quits this window instance.

requestAnimationFrame(fn) (static)

Execute a callback for the next frame.

Arguments:
fn (Function)

The callback function

list (String[])

List of the selected items

setFrame(x_pos=0, y_pos=0, hh=0, nn=0) (static)

Execute a callback for the next frame.

Arguments:
x_pos

(Integer | String): x position

y_pos

(Integer | String): x position

hh (Integer)

? position

nn (Integer)

? position

setSize(width, heigth) (static)

Set the size of the window.

Arguments:
width (Integer)

The width to set to

heigth (Integer)

The heigth to set to

__nidium__(readonly)

  • Type: Object

Details for this browser's framework.

console.log(JSON.stringify(window.navigator));

canvas

  • Type: Canvas

The main canvas instance.

cursor

  • Type: String

Set/Get the windows's cursor value.

innerHeight

  • Type: Integer

Set/Get the windows's innerHeight value.

innerWidth

  • Type: Integer

Set/Get the windows's innerWidth value.

left

  • Type: Integer

Set/Get the windows's left value.

navigator(readonly)

  • Type: Navigator

Details for this browser.

console.log(JSON.stringify(window.navigator));

outerHeight

  • Type: Integer

Set/Get the windows's outerHeight value.

title

  • Type: String

Set/Get the windows's title value.

titleBarColor

  • Type: Integer

Set/Get the windows's titleBarColor value.

titleBarControlOffsetX

  • Type: Integer

Set/Get the windows's titleBarControlOffsetX value.

titleBarControlOffsetY

  • Type: Integer

Set/Get the windows's titleBarControlOffsetY value.

top

  • Type: Integer

Set/Get the windows's top value.

Event: _onFileDrag(event)

function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

files (String[])

Array of filenames

Event: _onFileDragDrop(event)

function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

files (String[])

Array of filenames

Event: _onFileDragEnter(event)

function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

files (String[])

Array of filenames

Event: _onFileDragLeave(event)

function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

files (String[])

Array of filenames

Event: _onassetready(event)

Function that is called when the window has loaded all the assets.

Parameters:
event (Object)

EventMessage

data (String)

string in utf8 encoding

tag (String)

tag name

id (String)

id of the object

Event: _onblur()

Function that is called when the window looses the focus.

Event: _onclose(event)

Function that is called when the window will be closed.

Parameters:
event (WindowEvent)

EventMessage

Event: _onfocus()

Function that is called when the window receives the focus.

Event: _onkeydown(event)

Function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

keyCode (Integer)

keycode used

location (Integer)

location used

altKey (Boolean)

alt used

ctrlKey (Boolean)

ctrl used

shiftKey (Boolean)

shift used

metaKey (Boolean)

meta used

spaceKey (Boolean)

space used

repeat (Boolean)

repeating

Event: _onkeyup(event)

Function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

keyCode (Integer)

keycode used

location (Integer)

location used

altKey (Boolean)

alt used

ctrlKey (Boolean)

ctrl used

shiftKey (Boolean)

shift used

metaKey (Boolean)

meta used

spaceKey (Boolean)

space used

repeat (Boolean)

repeating

Event: _onmousedown(event)

Function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

which (Integer)

mouse button

Event: _onmousemove(event)

function that is called when the window gets an mousemovement event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

xrel (Integer)

relative x position

yrel (Integer)

relative y position

clientX (Integer)

client x position

clientY (Integer)

client y position

files (String[])

Array of filenames

Event: _onmouseup(event)

Function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

x_pos (Integer)

x position

y_pos (Integer)

y position

clientX (Integer)

client x position

clientY (Integer)

client y position

which (Integer)

mouse button

Event: _onmousewheel(event)

Function that is called when the window gets an mouse wheel event.

Parameters:
event (Object)

EventMessage

xrel (Integer)

x relative position

yres (Integer)

x relative position

x_pos (Integer)

x position

y_pos (Integer)

y position

Event: _onready(event)

Function that is called when the window is ready.

Parameters:
event (WindowEvent)

EventMessage

Event: _onsystemtrayclick(event)

Function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

id (Integer)

event id

Event: _ontextinput(event)

function that is called when the window gets an " + i + " event.

Parameters:
event (Object)

EventMessage

val (String)

value (utf8)


Caught a mistake or want to contribute to the documentation? Edit this page on GitHub!