class
TUI::ScrollableWidget
- TUI::ScrollableWidget
- Reference
- Object
Overview
Adapts a plain Widget to the Scrollable interface so it can be hosted as a SplitWindow pane, which only accepts Scrollable (see SplitWindow's shared border/scrollbar chrome, driven entirely off Scrollable's content_size/render_content/header_rows). The wrapped widget has no scrollable content of its own from SplitWindow's point of view — content_size always matches whatever's visible, so the pane's scrollbar shows full and never scrolls; the widget is free to implement its own internal scrolling (as Window does for its content) if it needs to.
Included Modules
Defined in:
tui/widget/scrollable_widget.crConstructors
Instance Method Summary
-
#content_size : Int32
Total scrollable content rows.
-
#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).
-
#handle_key(ev : KeyEvent, scroll : ScrollControl) : Bool
Everything but positional mouse hit-testing.
-
#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). - #status_hint : String
- #title : String
- #title=(title : String)
Instance methods inherited from module TUI::Scrollable
content_size : Int32
content_size,
focus_if(condition : Bool) : Nil
focus_if,
focused=(focused : Bool)
focused=,
focused? : Bool
focused?,
handle_click(local_row : Int32, local_col : Int32, scroll : ScrollControl) : Bool
handle_click,
handle_key(ev : KeyEvent, scroll : ScrollControl) : Bool
handle_key,
header_rows : Int32
header_rows,
render_content(buffer : Buffer, scroll : ScrollControl) : Nil
render_content,
status_hint : String
status_hint,
title : String
title
Constructor Detail
Instance Method Detail
Total scrollable content rows. Does NOT include a header row — header is content-internal (TableView-specific), not Window's.
A positional (mouse) event, pre-translated by Window into content-local row/col (0,0 = content's own first cell).
Everything but positional mouse hit-testing.
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.