Tree.height read/write property
Get or set the height of the Tree. The height starts from 0 (top side of the Tree) and increase to the bottom direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Tree.height sample", 320, 300)
local tree = ui.Tree(win, {"Item 1", "Item 2"}, 100, 10)
local inc_btn = ui.Button(win, "Increase Tree.height", 40, 270)
local dec_btn = ui.Button(win, "Decrease Tree.height", inc_btn.x+inc_btn.width+6, inc_btn.y)
inc_btn.delta = 10
dec_btn.delta = -10
local function onClick(self)
tree.height = tree.height + self.delta
end
inc_btn.onClick = onClick
dec_btn.onClick = onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible