Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:CreateWindow

From RoR Wiki

UI Lua API · Interface functions
Version: WAR 1.4.8

Creates a top-level window from the window definition of the same name.

CreateWindow(windowName, show)

Arguments

windowName
string – Name of a window defined in a loaded XML file. The new window gets the same name.
show
boolean – true to show the window at once, false to create it hidden.

Returns

Nothing.

Details

  • The window is created as a child of the root window. To create a window with a different name or under another parent, use CreateWindowFromTemplate.
  • If a window with this name already exists, it is not created again and an error is logged. The exception is a window that is waiting for a deferred DestroyWindow: it is taken off the destroy list and kept, and its showing flag is set to show.
  • If no definition with this name exists, the error ERROR: Unable to create window: %s is logged.
  • show must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • The function needs at least two arguments and only reads the last two.
  • Use DoesWindowExist to check first if the window may already exist.

Errors

These are written to the UI log; the call returns normally.

  • ERROR: Unable to create window: %s
  • ERROR: Window with this name already exists: %s

Example

From easystem_dialogmanager/source/dialogmanager.lua:

CreateWindow( "OneButtonDlg"..dlg, false )

See also