ui.run(main_window)

Run a new Task that updates the user interface asynchronously.

Parameters

main_waindow

A Window object instance that represents the main Window.

The main Window will be automatically shown and will determine the end of the Task once it has been closed.

Return value

This function returns the Task that updates the user interface asynchronously.

Example

local ui = require "ui" -- create a Window local win = ui.Window("ui.run() example", 320, 200) local button = ui.Button(win, "Click me !") button:center() function button:onClick() ui.info("You have clicked on the button !") end -- Shows and update ui until win is closed ui.run(win):wait()