Panel:onShow() event
This event is fired when the Panel is shown (with a call to Panel:show() or setting the Panel.visible property to true).
Return value
The event returns no value.Example
local ui = require "ui"
-- create a fixed Window
local win = ui.Window("Panel:onShow() event sample", "fixed", 320, 200)
-- create a Panel
local panel = ui.Panel(win, 0, 0, 100, 100)
panel.bgcolor = 0xF0A000
function panel:onShow()
win:status("Panel is shown")
end
function panel:onHide()
win:status("Panel is hidden")
end
async(function()
while true do
sleep(1000)
panel.visible = not panel.visible
end
end)
panel:onShow()
panel:center()
ui.run(win):wait()