class
TUI::Window
- TUI::Window
- TUI::Widget
- Reference
- Object
Overview
Owns the border, scrollbar, and scroll position for a hosted Scrollable — the piece that lets content be embedded either standalone (bordered) or side-by-side in a layout container like HSplit (borderless, no shared chrome of its own).
Defined in:
tui/widget/window.crConstructors
-
.full_screen(screen : Screen, content : Scrollable, bordered : Bool = true) : Window
Sizes and positions a Window to fill the screen below the status bar row — the same geometry Runtime#push resizes any full-screen page widget to, spelled once here instead of every call site re-deriving
1, 1, screen.cols, screen.rows - 1by hand. - .new(x : Int32, y : Int32, width : Int32, height : Int32, content : Scrollable, bordered : Bool = true)
Instance Method Summary
-
#border_style : Style
Applied to the box border drawn by #render when #bordered? is true.
-
#border_style=(border_style : Style)
Applied to the box border drawn by #render when #bordered? is true.
-
#bordered=(bordered : Bool)
Whether to draw the box border/scrollbar chrome around #content — false for panes embedded borderless inside a layout container like HSplit, which supplies its own shared chrome instead.
-
#bordered? : Bool
Whether to draw the box border/scrollbar chrome around #content — false for panes embedded borderless inside a layout container like HSplit, which supplies its own shared chrome instead.
-
#handle_key(ev : KeyEvent) : Bool
Returns true if the key was consumed.
-
#render : Nil
Draw into @buffer using LOCAL coordinates (0, 0 = this widget's own top-left).
-
#reset_scroll : Nil
Resets scroll position.
-
#scrollbar_style : Style
Applied to the scrollbar track and thumb drawn by #render when #bordered? is true — defaults to whatever #border_style currently is, so scrollbar and border stay visually matched unless a caller explicitly sets this to something else.
- #scrollbar_style=(style : Style) : Nil
-
#status_hint : String
Plain text describing the actions available in the widget's current state.
Instance methods inherited from class TUI::Widget
absolute(row : Int32, col : Int32) : NamedTuple(row: Int32, col: Int32)
absolute,
composite(screen : Screen) : Nil
composite,
focus_if(condition : Bool) : Nil
focus_if,
focused=(focused : Bool)
focused=,
focused? : Bool
focused?,
handle_key(ev : KeyEvent) : Bool
handle_key,
height : Int32
height,
height=(height : Int32)
height=,
local(row : Int32, col : Int32) : NamedTuple(row: Int32, col: Int32)
local,
render : Nil
render,
render_to(buffer : Buffer) : Nil
render_to,
status_hint : String
status_hint,
width : Int32
width,
width=(width : Int32)
width=,
x : Int32
x,
x=(x : Int32)
x=,
y : Int32
y,
y=(y : Int32)
y=
Constructor methods inherited from class TUI::Widget
new(x : Int32, y : Int32, width : Int32, height : Int32)
new
Constructor Detail
Sizes and positions a Window to fill the screen below the status
bar row — the same geometry Runtime#push resizes any full-screen
page widget to, spelled once here instead of every call site
re-deriving 1, 1, screen.cols, screen.rows - 1 by hand.
Instance Method Detail
Applied to the box border drawn by #render when #bordered? is true.
Applied to the box border drawn by #render when #bordered? is true.
Whether to draw the box border/scrollbar chrome around #content — false for panes embedded borderless inside a layout container like HSplit, which supplies its own shared chrome instead.
Whether to draw the box border/scrollbar chrome around #content — false for panes embedded borderless inside a layout container like HSplit, which supplies its own shared chrome instead.
Returns true if the key was consumed.
Draw into @buffer using LOCAL coordinates (0, 0 = this widget's own
top-left). Widgets never need to know their own x/y offset to draw
themselves — that arithmetic is handled entirely by composite.
Resets scroll position. Content itself has no Scroller to reset — callers that mutate content directly (e.g. loading new data into a DetailView outside the normal handle_key flow) call this afterward.
Applied to the scrollbar track and thumb drawn by #render when #bordered? is true — defaults to whatever #border_style currently is, so scrollbar and border stay visually matched unless a caller explicitly sets this to something else. Resolved fresh on every read (not captured once), so an unset scrollbar_style keeps tracking border_style even if border_style is changed later.
Plain text describing the actions available in the widget's current state. Rendered by the App in the global status bar at the bottom of the screen — widgets must NOT draw their own hint lines.