Skip to content

Modern Tui TuiStack ChildRect

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

Home › Terminal TUI Library › Widgets › TuiStack.ChildRect

TuiStack.ChildRect

Returns the rectangle a child got at the last Render, for mouse hit tests.

Syntax

TuiStack.ChildRect( byval i as int32 ) as TuiRect

Description

The rect a child was given at the last Render. Use it for hit-testing a mouse click against a child -- the layout is not stored anywhere else, because it is recomputed every frame.

Example

#import "std/tui"
using tui

dim as TuiScreen scr
scr.Resize( 20, 6 )
dim as TuiFrame ptr f = scr.BeginFrame( )

dim as TuiStack st
st.vertical = TRUE
st.Add( new TuiParagraph, TuiLength( 2 ) )
st.Add( new TuiParagraph, TuiFill( ) )
st.Render( *f, f->Area( ) )

print st.ChildRect( 0 ).h         '' 2
print st.ChildRect( 1 ).h         '' 4

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