Skip to content

Modern Tui TuiFrame

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

Home › Terminal TUI Library › Buffer and Frame › TuiFrame

TuiFrame

Holds the surface View draws on; drawing never fails and is clipped to fit.

Syntax

type TuiFrame
    declare function Area( ) as TuiRect
    declare function DrawText( ... ) as int32
    ...
end type

Description

The per-frame draw target: a buffer plus a clip rect and a layer stack. DRAWING CANNOT FAIL -- everything is clipped and out-of-clip writes are dropped silently, which is why no drawing call returns a Result and why widget code reads the way it does.

Example

#import "std/tui"
using tui

dim as TuiScreen scr
scr.Resize( 40, 10 )
dim as TuiFrame ptr f = scr.BeginFrame( )

f->DrawText( 0, 0, "hello", TuiStyleDefault( ) )
f->DrawText( -100, -100, "off screen", TuiStyleDefault( ) )   '' dropped, no error
print len( scr.Render( TUIDEPTH_ANSI16 ) ) > 0 '' -1 (true)

See also

TuiCell TuiCell.Equals TuiBuffer TuiBuffer.Clear TuiBuffer.At TuiFrame.Area
TuiCell.SetChar TuiCellBlank TuiBuffer.Resize TuiBuffer.InBounds TuiBuffer.Count TuiFrame.Clip

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


Home · Keyword Index

Clone this wiki locally