Edit:onClick(x, y) event
This event is fired when the user has clicked on the Edit.
Parameters
x
The horizontal position of the mouse in the Edit area.
y
The vertical position of the mouse in the Edit area.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Edit:onClick() sample", 400, 300)
win:status("Click on the Edit !")
local edit = ui.Edit(win, "Edit")
edit:center()
-- set a onClick() event
function edit:onClick(x, y)
win:status("Good Job ! You have clicked at position "..x..", "..y)
end
win:show()
while win.visible do
ui.update()
end