Skip to content

Modern Tui TuiBlock

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

Home › Terminal TUI Library › Core Widgets › TuiBlock

TuiBlock

Draws a border with titles and an optional fill; Inner gives the space inside.

Syntax

type TuiBlock extends TuiWidget
    as uint8 borderKind, sides
    as TuiStyle borderStyle, fillStyle
    as boolean fill
    as TuiTitleArray titles
end type

Description

A border with titles, and the Inner( ) rect inside it. Almost every panel starts with one. borderKind carries the underscore-free awkwardness of this module's naming: plain kind collides with the abstract Kind( ) method.

Example

#import "std/tui"
using tui

dim as TuiScreen scr
scr.Resize( 30, 8 )
dim as TuiFrame ptr f = scr.BeginFrame( )
dim as TuiTheme th = TuiThemeDefault( )

dim as TuiBlock b
b.borderKind = TUIBORDER_ROUNDED  '' NONE PLAIN ROUNDED DOUBLE THICK ASCII
b.sides = TUISIDE_ALL             '' or TUISIDE_TOP or TUISIDE_LEFT, bitwise
b.borderStyle = th.border
b.fill = TRUE
b.fillStyle = th.normal
b.AddTitle( " cpu ", th.accent, TUISIDE_TOP, TUIALIGN_LEFT )
b.Render( *f, f->Area( ) )

dim as TuiRect inner = b.Inner( f->Area( ) )
print inner.x, inner.y, inner.w, inner.h        '' 1 1 28 6

See also

TuiBlock.Inner TuiBorderSet TuiTitle TuiParagraph TuiListState TuiTable
TuiBlock.AddTitle TuiBorderGlyphs TuiTitleOf TuiList TuiRow TuiTableState

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


Home · Keyword Index

Clone this wiki locally