module

TUI::Scrollable

What a widget hosted inside a Window must provide. Unlike Widget, a Scrollable has no x/y of its own and does not own a Buffer, a border, or a Scroller — Window supplies all of that.

Instance methods

content_size

Total scrollable content rows. Does NOT include a header row — header is content-internal (TableView-specific), not Window's.

Source
focus_if(condition : Bool) : Nil
Source
focused=(focused : Bool)

Gates whether #handle_key/#handle_click should be given a chance to consume the current event, same convention as Widget#focused? — toggle it via #focus_if.

Source
focused?

Gates whether #handle_key/#handle_click should be given a chance to consume the current event, same convention as Widget#focused? — toggle it via #focus_if.

Source
handle_click(local_row : Int32, local_col : Int32, scroll : ScrollControl) : Bool

A positional (mouse) event, pre-translated by Window into content-local row/col (0,0 = content's own first cell).

Source
handle_key(ev : KeyEvent, scroll : ScrollControl) : Bool

Everything but positional mouse hit-testing.

Source
header_rows

Rows reserved above the data rows (e.g. a table's column header) that Window must exclude from the visible/scrollable viewport size it hands to its Scroller and ScrollControl (see Window#render/ #handle_key) — content still draws this row itself via #render_content; Window never draws it and has no other way to know it exists. Defaults to 0 (no header), so existing Scrollables need no changes.

Source
render_content(buffer : Buffer, scroll : ScrollControl) : Nil

Render into buffer, a region already sized to the content area (border/scrollbar column already excluded by Window). Row 0 is content's own first row.

Source
status_hint
Source
title
Source