Skip to content

Modern Tui TuiFrame PushClip

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

Home › Terminal TUI Library › Buffer and Frame › TuiFrame.PushClip

TuiFrame.PushClip

Limits drawing to a rectangle and returns the previous limit, to restore later.

Syntax

TuiFrame.PushClip( byval r as TuiRect ) as TuiRect

Description

Narrows the clip to the intersection of the current clip and r, and RETURNS THE OLD ONE so you can restore it. Widgets use this so a child cannot draw outside its area.

Example

#import "std/tui"
using tui

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

dim as TuiRect saved = f->PushClip( TuiRectOf( 0, 0, 5, 6 ) )
f->DrawText( 0, 0, "0123456789", TuiStyleDefault( ) )
f->PopClip( saved )

'' only the first five columns landed
print scr.Back( )->At( 4, 0 )->width       '' 1

See also

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

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