Window

References a window of the program. At the moment we can access only the main window using app.window.

Window.width

local width = app.window.width

Returns the width of the main window.

Window.height

local height = app.window.height

Returns the height of the main window.

Window.events

Returns the Events object to associate functions that can act like listeners of specific Window events. E.g.

app.window.events:on('resize',
  function(ev)
    print('Now the main window is', ev.width, ev.height)
  end)

Available events for a Window:

  • 'resize': When the user resizes the window.