TreeItem.parent readonly property
Get the object that owns the TreeItem, either a :
- Tree, when the TreeItem is a root item in the Tree.
- TreeItem Tree, when the Treeitem is a subitem of another TreeItem.
Return value
This function returns no value.Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("TreeItem.parent sample", "fixed", 320, 250)
local tree = ui.Tree(win, {["Tab 1"] = {"SubItem1", "SubItem2"}, "Tab 2", "Tab 3"})
function tree:onSelect(item)
win:status(item.text.." parent is "..(item.parent.text or type(item.parent)))
end
win:show()
-- update user interface
repeat
ui.update()
until not win.visible