Panel:onClick(x, y) event
This event is fired when the user has clicked on the Panel.
Parameters
x
The horizontal position of the mouse in the Panel's client area.
y
The vertical position of the mouse in the Panel's client area.
Return value
This event returns no value.Example
local ui = require "ui"
-- create a fixed Panel
local win = ui.Window("Panel:onClick() event sample", "fixed", 320, 200)
-- create a Panel
local panel = ui.Panel(win, 0, 0, 100, 100)
panel:center()
win:status("Click on the Panel to change its color")
function panel:onClick()
self.bgcolor = math.random(0xFFFFFF)
end
panel:onClick()
ui.run(win):wait()