Tree:onShow() event
This event is fired when the Tree is shown (with a call to Tree:show() or setting the Tree.visible property to true).
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Tree:onShow() sample", 320, 200)
local button = ui.Button(win, "Click me !", 125, 30)
local tree = ui.Tree(win, {"Item 1", "Item 2"}, 120, 80)
tree:hide()
-- set a onClick() event : shows the Tree
function button:onClick(y)
win:status("Hurry up, make a choice!")
tree:show()
end
-- set a onShow() event : Hides the Tree after 2 seconds
function tree:onShow()
sleep(2000)
tree:hide()
end
ui.run(win):wait()