Tree:constructor(parent, items, [x], [y], [width], [height])constructor


The Tree constructor returns a Tree value representing a scrollable tree of items.

Parameters

parent

An object that will own the Tree. Parent objects can be any of Window, Groupbox, TabItem and Panel

items

A table containing a list of strings with or without tables values (each string will be inserted in the Tree, tables represent subitems).

[x]

An optional number that indicates the Tree horizontal position, in pixels. Zero means the left border of the parent.

[y]

An optional number that indicates the Tree vertical position, in pixels. Zero means the top border of the parent.

[width]

An optional number that indicates the Tree width in pixels.

[height]

An optional number that indicates the Tree height in pixels.

Return value

The constructor returns a new Tree instance.

Example

--! luart-extensions import ui local win = ui.Window("ui.Tree() constructor sample", "fixed", 320, 200) local tree = ui.Tree(win, {"Item 1", "Item 2", ["Item 3"] = {"SubItem1", "SubItem2"}}, 106, 20) -- show the Window win:show() while win.visible do ui.update() end