Radiobutton:onHover(x, y, buttons)event
This event is fired when the user moves the mouse pointer over the Radiobutton.
Parameters
x
The horizontal position of the mouse in the Radiobutton area (zero means the left border of the widget).
y
The vertical position of the mouse in the Radiobutton area (zero means the top border of the widget).
buttons
A table which fields indicates if mouse buttons or special keys have been pressed during the move :
"left":trueif left mouse button is pressed,falseotherwise"right":trueif right mouse button is pressed,falseotherwise"middle":trueif middle mouse button is pressed,falseotherwise"control":trueif the CONTROL key is pressed,falseotherwise"shift":trueif the SHIFT mouse button is pressed,falseotherwise
Return value
The event returns no value.Example
--! luart-extensions
import ui
-- create a custom widget from a Radiobutton
local LinkRadiobutton = Object(ui.Radiobutton)
function LinkRadiobutton:onCreate()
self.cursor = "hand"
end
-- sets the onHover event
function LinkRadiobutton:onHover()
self.fontstyle = { underline = true }
end
-- sets the onLeave event
function LinkRadiobutton:onLeave()
self.fontstyle = { underline = false }
end
-- create a window
local win = ui.Window("Label:onLeave() sample", 320, 200)
-- create a LinkRadiobutton object
local radiobutton = LinkRadiobutton(win, "Click Me !", 120, 75)
function radiobutton:onClick()
win:status("LinkRadiobutton is "..(self.checked and "checked" or "unchecked"))
end
radiobutton:onClick()
win:show()
while win.visible do
ui.update()
end