Checkbox:onMouseUp(button, x, y) event
This event is fired when the user releases a mouse button while beeing over the Checkbox.
Parameters
button
A string indicating the button that has been released : "right"
, "middle"
or "left"
.
x
The horizontal position of the mouse in the Checkbox area (zero means the left border of the widget).
y
The vertical position of the mouse in the Checkbox area (zero means the top border of the widget).
Return value
The event returns no value.Example
local ui = require "ui"
-- create a window
local win = ui.Window("Checkbox:onMouseUp() sample", 460, 200)
local check = ui.Checkbox(win, "Move the mouse over this Checkbox and press, then release a mouse button!")
check:center()
-- set a onMouseUp() event : display a status bar with the pressed mouse button and its position
function check:onMouseUp(b, x, y)
win:status("Mouse button : "..b, "Mouse position : "..x..", "..y)
end
ui.run(win):wait()