Tree.y read/write property


Get or set the Tree vertical position. The vertical position start from 0 (top side of the parent widget) and increase to the bottom side of the parent widget.

Example

local ui = require "ui" -- create a simple window local win = ui.Window("Tree.y sample", 600, 300) local button = ui.Button(win, "Change Tree position", 240) local tree = ui.Tree(win, {'Item 1', 'Item 2'}, 10, 140) function button:onClick() tree.x = math.random(10, win.width-tree.width) tree.y = math.random(40, win.height-tree.height) end -- shows the window win:show() -- update user interface and increase Tree horizontal position repeat ui.update() until not win.visible