Window:showmodal(child) method


Show and activate a child Window. The parent widget is disabled and can not be used until the user closes the child Window.

Parameters

child

The Window object that will be shown.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Window:showmodal() sample", 320, 200) local button = ui.Button(win, "Window:showmodal(child)", 90, 80) -- create a child modal window local child = ui.Window("Modal window", 265, 100) local label = ui.Label(child, "I'm a modal Window, close me now\nto return to the parent Window", 40, 30) label.textalign = "center" function button:onClick() child.x, child.y = ui.mousepos() win:showmodal(child) end win:show() while win.visible do ui.update() end