TUI::Buffer
A widget-local grid of cells. Widgets draw into their own Buffer using coordinates relative to their own top-left (0, 0) — never absolute terminal coordinates. The compositor (Screen) blits each widget's Buffer onto the real screen at the widget's x/y offset.
Constructors
Instance methods
Draw a box with an optional title in the top border, in local coords.
style applies only to the border glyphs themselves — a title's own
text is drawn plain here (its emphasis, if any, is the widget's own
concern, e.g. ListView#title_style) so it doesn't inherit the
border's color.
Draw a box like #box, but with a T-junction character injected into
the top and bottom border rows at local column divider_at — used
by SplitWindow to merge its internal pane divider into the outer
border. This is a degenerate single-divider stamp (draw a plain
box, then overwrite one cell per row) rather than a composed
Term.border_line call — it doesn't contain segment/junction math to
unify, and rebuilding it in those terms would risk changing how a
title long enough to reach divider_at currently gets partially
overwritten by the injected junction glyph.
Draw a horizontal separator spanning w columns at (y, x). left_join / right_join use ├ / ┤ instead of └ / ┘.
Draws a vertical scrollbar in column x, h rows tall starting at
y. fraction is the 0.0 (top) to 1.0 (bottom) position of the
viewport, visible/total size the thumb proportionally.
fraction nil means no scrollbar (content fits entirely, nothing
to indicate). inset reserves that many rows off each end of h
before drawing — the default of 1 matches the original use (a
box's own top/bottom border rows straddle the track); pass inset: 0 to span the full h rows, e.g. a borderless field with no
border rows to skip (see ScrollableField#render).
Write a string starting at local (row, col), 0-indexed. ANSI escape
sequences in s are tracked as the running style and attached to each
subsequent plain character's cell, rather than being written as their
own cells — this lets the compositor diff on (char, style) per cell.
Draw a vertical line of h rows starting at (y, x), local coords.
Fixed size in cells, set at construction. A widget wanting a different size builds a new Buffer (see Widget#composite) rather than resizing this one in place.