TreeItem.text
Get or set the item caption as a string.
Example
--! luart-extensions
import ui
-- create a simple Window
local win = ui.Window("TreeItem.text sample", "fixed", 360, 150)
local label = ui.Label(win, "Select an item :", 90, 30)
local Tree = ui.Tree(win, {"LuaRT", "is", "fun !"}, label.x+label.width+6, label.y-4)
-- set the selected item to the first item "LuaRT"
Tree.selected = Tree.items[1]
function Tree:onSelect(item)
-- update window status with the item caption
win:status("You have selected = "..item.text)
end
win:show()
-- update user interface
repeat
ui.update()
until not win.visible