Window:tofront( window ) method


Brings the current Window in front of all other windows, or in front of the specified window.

Parameters

window

The window above which the current Window will be.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a simple Window local win1 = ui.Window("Window1", 400, 300) local win2 = ui.Window("Window2", 400, 300) local button = ui.Button(win2, "Click me to bring Window1 to front") button:center() win1:show() win2:show() -- Button:onClick() event function button:onClick() win1:tofront() end -- update the user interface until the user closes the Window repeat ui.update() until not win1.visible