Button:onLeave() event
This event is fired when the mouse cursor leaves the Button.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a custom widget from a Button
local BoldButton = Object(ui.Button)
-- sets the onHover event
function BoldButton:onHover()
self.fontstyle = { bold = true }
end
-- sets the onLeave event
function BoldButton:onLeave()
self.fontstyle = { bold = false }
end
-- create a window
local win = ui.Window("Button:onLeave() sample", 320, 200)
--create a BoldButton object
local button = BoldButton(win, "Click Me !", 100, 75)
function button:onClick()
ui.info("You have clicked a '"..type(self).."'")
end
ui.run(win):wait()