Picture:onShow() event
This event is fired when the Picture is shown (with a call to Picture:show() or setting the Picture.visible property to true).
Return value
The event returns no value.Example
local ui = require "ui"
-- create a simple window
local win = ui.Window("Picture:onShow() sample", 340, 200)
local picture = ui.Picture(win, "examples/ui/LuaRT.png", -74)
local button = ui.Button(win, "Click Me !", 130, 170)
picture:hide()
-- set a onClick() event : shows the Picture
function button:onClick(x, y)
picture:show()
end
function picture:onHide()
sleep(500)
picture:show()
end
-- set a onShow() event : Hides the Picture after 2 seconds
function picture:onShow()
sleep(500)
picture:hide()
end
ui.run(win):wait()