Skip to content

Modern Tui TuiRect IsEmpty

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

Home › Terminal TUI Library › Geometry › TuiRect.IsEmpty

TuiRect.IsEmpty

Returns true if the rectangle has no width or no height.

Syntax

TuiRect.IsEmpty( ) as boolean

Description

True when the rect has no area. Test it after every Intersect and after taking the Inner( ) of a small block -- a border on a 1x1 area leaves nothing inside, and drawing into an empty rect is a silent no-op rather than an error.

Example

#import "std/tui"
using tui

print TuiRectOf( 0, 0, 10, 4 ).IsEmpty( )     '' false
print TuiRectOf( 0, 0, 0, 4 ).IsEmpty( )      '' true
print TuiRectOf( 0, 0, 10, -1 ).IsEmpty( )    '' true -- negative counts too

'' the usual guard, straight out of every widget in the module
dim as TuiRect inner = TuiRectOf( 0, 0, 2, 2 ).Inner( TuiMarginAll( 1 ) )
if( inner.IsEmpty( ) ) then print "nothing to draw"

See also

TuiRect TuiRect.Bottom TuiRect.Intersect TuiRect.Equals TuiSize TuiPos
TuiRect.Right TuiRect.Contains TuiRect.Inner TuiRectOf TuiSizeOf TuiMargin

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


Home · Keyword Index

Clone this wiki locally