Label:onLeave() event
This event is fired when the mouse cursor leaves the Label.
Return value
The event returns no value.Example
local ui = require "ui"
-- create a custom widget from a Label
local Link = Object(ui.Label)
-- sets the cursor property once the Link object is created
function Link:onCreate()
self.cursor = "hand"
end
-- sets the onHover event
function Link:onHover()
self.fontstyle = { underline = true }
end
-- sets the onLeave event
function Link:onLeave()
self.fontstyle = { underline = false }
end
-- sets the onClick event : open the link in the default web browser
function Link:onClick()
sys.cmd("start "..self.text)
end
-- create a window
local win = ui.Window("Label:onLeave() sample", 320, 200)
--create a Link object
local link = Link(win, "https://www.luart.org", 100, 75)
win:show()
while win.visible do
ui.update()
end