Panel:toback( widget ) method
Puts the Panel behind all other widgets, or behind the specified widget.
Parameters
widget
The widget below which the current Panel will be.
Return value
This function returns no value.Example
local ui = require "ui"
-- create a fixed Window
local win = ui.Window("Panel:toback() sample", "fixed", 320, 200)
-- create a Panel
local panel1 = ui.Panel(win, 0, 0, 100, 100)
panel1.bgcolor = 0xF0A000
panel1:center()
local panel2 = ui.Panel(win, 0, 0, 100, 100)
panel2.bgcolor = 0x00a0F0
panel2.x = panel1.x + 12
panel2.y = panel1.y - 10
ui.Button(panel1, "Back", 16, 36).onClick = function()
panel1:toback(panel2)
end
ui.Button(panel2, "Back", 16, 36).onClick = function()
panel2:toback(panel1)
end
ui.run(win):wait()