Tree:onHover() event
This event is fired when the user moves the mouse pointer over the Tree.
Parameters
x
The horizontal position of the mouse in the Tree area (zero means the left border of the widget).
y
The vertical position of the mouse in the Tree area (zero means the top border of the widget).
Return value
The event returns no value.Example
local ui = require "ui"
-- creates a simple window
local win = ui.Window("Tree:onLeave() event sample", 320, 200)
local tree = ui.Tree(win, {"TreeItem 1", "TreeItem 2", "TreeItem 3"}, 100, 10)
-- Tree:onHover event
function tree:onHover()
win:status("You are hovering the Tree Widget")
end
-- Tree:onLeave event
function tree:onLeave()
win:status("The Tree Widget is no longer hovered")
end
win:status("")
win:show()
-- update window
while win.visible do
ui.update()
end