esferatec
I used the following script:
local ui = require("ui")
local os = require("os")
local win = ui.Window("Window Events Example", 500, 400)
local button1 = ui.Button(win, "Hide/Show", 10, 10)
local button2 = ui.Button(win, "Maximize me !", 10, 35)
local button3 = ui.Button(win, "Minimize me !", 10, 70)
function win:onShow()
print(os.date() .. " - onShow()")
end
function win:onHide()
print(os.date() .. " - onHide()")
end
function win:onClose()
print(os.date() .. " - onClose()")
end
function win:onMove()
print(os.date() .. " - onMove()")
end
function win:onResize()
print(os.date() .. " - onResize()")
end
function win:onClick(x, y)
print(os.date() .. " - onClick()")
end
function win:onContext()
print(os.date() .. " - onContext()")
end
function win:onKey(key)
print(os.date() .. " - onKey()")
win:status("Pressed Key : "..key)
end
function win:onCreate()
print(os.date() .. " - onCreate()")
end
function button1:onClick()
win:hide()
sleep(1000)
win:show()
end
function button2:onClick()
win:maximize()
end
function button3:onClick()
win:minimize()
end
win:show()
repeat
ui.update()
until not win.visible