Skip to content

Modern Tui TuiStack

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

Home › Terminal TUI Library › Widgets › TuiStack

TuiStack

Holds child widgets laid out in a row or column; it deletes them when it goes.

Syntax

type TuiStack extends TuiWidget
    as TuiWidgetPtrArray children
    as TuiConstraintArray constraints
    as boolean vertical
end type

Description

A container that lays its children out with the constraint solver and forwards events to them. UNLIKE EVERY OTHER WIDGET IT OWNS ITS CHILDREN -- the destructor deletes them, so Add things you allocated with NEW.

Example

#import "std/tui"
using tui

dim as TuiStack st
st.vertical = TRUE

dim as TuiParagraph ptr a = new TuiParagraph
a->text = "top"
st.Add( a, TuiLength( 1 ) )       '' the stack now owns `a`

dim as TuiParagraph ptr b = new TuiParagraph
b->text = "bottom"
st.Add( b, TuiFill( ) )

print st.children.Count( )        '' 2
'' no delete here: ~TuiStack does it

See also

TuiWidget TuiWidget.HandleEvent TuiWidget.SetFocused TuiFocusRing.Clear
TuiWidget.Render TuiWidget.SizeHint TuiFocusRing TuiFocusRing.Count
TuiWidget.Kind TuiWidget.CanFocus TuiFocusRing.Add TuiFocusRing.Current

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Widgets
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally