Button:tofront( widget ) method
Brings the Button in front of all other widgets, or in front of the specified widget.
Parameters
parent
The widget above which the Button will be.
Return value
This function returns no value.Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Button:tofront() sample", 400, 300)
local widget = ui.Button(win, "I'am a Button")
widget:center()
local button = ui.Button(win, "Click me to bring Button to front")
button:center()
button:show()
-- Button:onClick() event
function button:onClick()
widget:tofront()
end
win:show()
-- update the user interface until the user closes the Window
repeat
ui.update()
until not win.visible