TreeΒΆ
class Tree
A simple tree list
This class implements basic behaviour for a tree organized list. It is possible to specialize some part of the tree behaviour to enrich the tree list window. By default, a Tree uses a simple tree of nested table, where children are stored in the array part. Each child might be a string or a table. If a child is a table, then Name must be filled with the child name.
local tree = ui.tree ("tree", parent)
tree:settree ( {
"leafA",
"leafB",
"leafC",
{ Name = "Node1",
"leafAA",
{ Name = "Node2",
"leafAAA",
"leafBBB",
"leafCCC",
},
"leafBB",
}
} )
Hierarchy
Members
| canexpanditem | (
|
Override This method must return true if the item can be expanded, to display the expand button |
| canselectitem | (
|
Override This method must return true if the item can be selected |
| getitemcolor | (
|
Override This method must return the text color for this item |
| getitemcount | (
|
Override This method must return the number of children item within a tree node. |
| getitemicon | (
|
Override This method must return the icon texture for this item, or nil if no icon is needed |
| getitemtext | (
|
Override This method must return the text for this item |
| getselection | ( ) | Return the selected item |
| selectionchanged | (
|
Override This method is called when the tree list selection has changed |
| setselection | (
|
Set the current selection |
| setttree | (
|
Update the tree list with the new given tree |
Inherited from class Window
| destroy | ( ) | Destroy the window and all its children windows |
| setx | (
|
Set the X window placement |
| sety | (
|
Set the Y window placement |
| setw | (
|
Set the window width |
| seth | (
|
Set the window height |
| getx | ( ) | Get the window X coordinate in the parent space |
| gety | ( ) | Get the window Y coordinate in the parent space |
| getw | ( ) | Get the window width |
| geth | ( ) | Get the window height |
| hide | ( ) | Hide the window |
| show | ( ) | Show the window |
| disable | ( ) | Disable the window |
| enable | ( ) | Enable the window |
| getnodepath | ( ) | Returns the edited node path (is nil if the method is not supported) |
| setnodepath | (
|
|
| addtracker | (
|
Add a tracker to this window. A tracker receives notification when the tracked window is invalidated or destroyed. A tracker may implement onTrackedDestroyed and onTrackedInvalidated to get notifications on such events |
| removetracker | (
|
Remove a tracker of this window. |
| setcolor | (
|
Change the window color, see also ui.color function |
| getparent | (
|
Get the first parent window of given class (immediate parent if no class is provided) |
| settopmost | ( ) | Set the window as top most in children order |
| getchild | (
|
Get a child window |
| getcontainer | ( ) | Get the main container of a window |
| settitle | (
|
Change the window title |
| setfocus | ( ) | Set the focus to the window |
| getroot | ( ) | Return the root window of this window |
Documentation
Override This method must return true if the item can be expanded, to display the expand button
item The tree item to query
expandable True iff item can be expanded
Override This method must return true if the item can be selected
item The tree item to query
selectable True iff item can be selected
Override This method must return the text color for this item
item The tree item to query
color The item displayed color
Override This method must return the number of children item within a tree node.
item The tree item to query
count The number of children in the item
Override This method must return the icon texture for this item, or nil if no icon is needed
item The tree item to query
icon The icon name, or nil for no icon
Override This method must return the text for this item
item The tree item to query
text The item displayed name
Return the selected item
selection The selected item
Override This method is called when the tree list selection has changed
selection The new selection
Set the current selection
item The new selected item
Update the tree list with the new given tree
tree The tree to be displayed