Tree:onClick(x, y) event


This event is fired when the user has clicked on the Tree.

Parameters

x

The horizontal position of the mouse in the Tree area.

y

The vertical position of the mouse in the Tree area.

Return value

The event returns no value.

Example

local ui = require "ui" -- create a window local win = ui.Window("Tree:onClick() sample", 400, 300) win:status("Click on the Tree !") local tree = ui.Tree(win, {"Tree"}) tree:center() -- set a onClick() event function tree:onClick(x, y) win:status("Good Job ! You have clicked at position "..x..", "..y) end win:show() while win.visible do ui.update() end