Skip to content

Modern Tui TuiTree Add

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Overlays and Chrome › TuiTree.Add

TuiTree.Add

Appends a node at a depth; the deeper nodes after it become its children.

Syntax

TuiTree.Add( byref label as ustring, byval depth as int32, byval hasChildren as boolean = FALSE, byval userId as int32 = 0 )

Description

Appends a node. Order matters: a node's children are the nodes that follow it with a greater depth, so build the array in the order you want it drawn.

Example

#import "std/tui"
using tui

dim as TuiTree t
t.Add( "root", 0, TRUE, 1 )
t.Add( "child", 1, FALSE, 2 )     '' a child BECAUSE it follows at depth 1
t.Add( "sibling", 0, FALSE, 3 )
print t.nodes.Count( )            '' 3
print t.nodes[1].depth            '' 1

See also

TuiPopup TuiMessageBox.Cancelled TuiMenuBar.IsOpen TuiStatusBar
TuiMessageBox TuiMenu TuiStatusItem TuiStatusBar.Add
TuiMessageBox.Accepted TuiMenuBar TuiStatusItemOf TuiTreeNode

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Overlays and Chrome
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally