Skip to content

Modern Tui TuiTreeNode

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

Home › Terminal TUI Library › Overlays and Chrome › TuiTreeNode

TuiTreeNode

Holds one tree node: its label, depth, whether it has children, and your own id.

Syntax

type TuiTreeNode
    as ustring label
    as int32 depth
    as boolean hasChildren
    as int32 userId
end type

Description

One node of a tree, held in a FLAT array with a depth rather than as a linked structure -- which is what makes scrolling and hit-testing simple. userId is yours: put a file id or a row key in it.

Example

#import "std/tui"
using tui

dim as TuiTree t
t.Add( "src", 0, TRUE, 100 )
t.Add( "main.tiko", 1, FALSE, 101 )
print t.nodes.Count( )            '' 2
print t.nodes[1].depth, t.nodes[1].userId      '' 1 101

See also

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

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