ui.mainWindow readwrite


Get or set the main Window, a Window object.
The main Window, when closed by the user, will stop the ui Task (event won't be processed anymore).

Notes

  • The first created main Window is the main Window by default.

Example

--! luart-extensions import ui local win = ui.Window("main Window", 320, 200) local other = ui.Window("other window", 320, 200) -- change mainWindow to be 'other' instead of 'win' ui.mainWindow = other function other:onClose() ui.info("Main window will now be closed !") end win:show() other:show() -- wait for all Tasks to complete (including for ui Task) waitall()