class

TUI::Screen

Inherits Reference < Object

Constructors

Instance methods

at(row : Int32, col : Int32, s : String) : Nil

Write directly into the back buffer at absolute terminal coordinates. For App-level drawing that isn't owned by any single widget (status bar, dividers between panes).

Source
blit(x : Int32, y : Int32, buffer : Buffer) : Nil

Composite a widget's local buffer onto the back buffer at (x, y). x/y are 1-based terminal coordinates (matching Widget#x/#y convention). Cells landing outside the currently active #with_clip rect (if any) are silently dropped, same "out of bounds is a no-op, not an error" convention Buffer#set_cell already uses for the screen's own edges.

Source
cell(row : Int32, col : Int32) : BufferCell

Read back a cell from the back buffer — the one composited widgets have just blitted into, before the next #flush swaps it to front. Exists for specs to assert on composited output; app code should never need to read cells back out of the screen it just drew.

Source
cols
Source
flush

Diff @back against @front, emit only changed cells, then swap.

The real terminal cursor stays hidden across frames — apps draw their own selection highlight (reverse-video rows, block glyphs for text input) rather than relying on the terminal's cursor to convey position. A caller that needs the native cursor visible (e.g. a text field mid-edit) should show it and move it itself after calling flush, then hide it again before the next flush.

Source
refresh_size
Source
rows

Current terminal size in character cells, refreshed by #refresh_size on resize. 0-based row/col math elsewhere in this class treats these as the exclusive upper bound.

Source
status_bar(row : Int32, text : String) : Nil

Status bar: fill entire row with reverse-video text (absolute coords).

Source
status_bar_style

Applied to the whole row drawn by #status_bar.

Source
status_bar_style=(status_bar_style : Style)

Applied to the whole row drawn by #status_bar.

Source
vline(x : Int32, y : Int32, h : Int32) : Nil

Draw a vertical line at absolute terminal coordinates, e.g. a divider between two side-by-side widget panes.

Source
with_clip(rect : ClipRect, & : -> Nil) : Nil

Bounds every #blit inside block to rect, intersected with whatever clip is already active (so a clip can only narrow, never widen, no matter how many containers are nested). Always restores the previous clip afterward, even if block raises, so a container's own clip can never leak past its own #composite call. Default (@clip nil) is "no bound" — existing callers that never call #with_clip see zero behavior change.

Source