TreeItem.previous readonly


Retrieves the previous sibling item before the TreeItem

Example

--! luart-extensions import ui -- create a fixed Window local win = ui.Window("TreeItem.previous sample", 320, 220) local tree = ui.Tree(win, {"TreeItem1", "TreeItem2", "TreeItem3"}, 60, 40, 200, 160) tree.selected = tree.items["TreeItem1"] tree.selected.subitems = {"SubItem1", "SubItem2"} ui.Button(win, "Next", 76, 10).onClick = function (self) local next = tree.selected.next if next then tree.selected = next end end ui.Button(win, "Previous", 156, 10).onClick = function (self) local prev = tree.selected.previous if prev then tree.selected = prev end end await win:showasync()