class

TUI::SplitWindow

Inherits TUI::Widget < Reference < Object

One bordered box hosting two Scrollable content areas side by side, each with its own independent scroll position. The left pane's right edge is the internal divider column, which doubles as its scrollbar track (Buffer#scrollbar accepts an arbitrary column, so this needs no new drawing primitive); the right pane's scrollbar renders on the outer right border column exactly as Window's single pane does.

Constructors

full_screen(screen : Screen, left : Scrollable, right : Scrollable, left_width : Int32 | Nil = nil, bordered : Bool = true) : SplitWindow

Sizes and positions a SplitWindow to fill the screen below the status bar row — see Window.full_screen for the same reasoning. left_width defaults to an even split.

Source
new(x : Int32, y : Int32, width : Int32, height : Int32, left : Scrollable, right : Scrollable, left_width : Int32, bordered : Bool = true)
Source

Instance methods

border_style

Applied to the box border and internal pane divider drawn by #render.

Source
border_style=(border_style : Style)

Applied to the box border and internal pane divider drawn by #render.

Source
bordered=(bordered : Bool)

Whether to draw the box border/scrollbar chrome — same convention as Window#bordered?.

Source
bordered?

Whether to draw the box border/scrollbar chrome — same convention as Window#bordered?.

Source
extra_hint

Appended (with a leading double-space separator, matching how #status_hint already joins its own @menu.hint with active_pane's) to #status_hint when non-empty — for a host embedding this SplitWindow that wants its own app-level bindings (e.g. a sidebar-hide toggle) reflected in the one status line #status_hint produces, without this widget needing to know anything about what those bindings do. A host intercepting a key ahead of this widget's own #handle_key (e.g. to special-case Tab while the left pane is hidden) is responsible for keeping this in sync with what it actually does.

Source
extra_hint=(extra_hint : String)

Appended (with a leading double-space separator, matching how #status_hint already joins its own @menu.hint with active_pane's) to #status_hint when non-empty — for a host embedding this SplitWindow that wants its own app-level bindings (e.g. a sidebar-hide toggle) reflected in the one status line #status_hint produces, without this widget needing to know anything about what those bindings do. A host intercepting a key ahead of this widget's own #handle_key (e.g. to special-case Tab while the left pane is hidden) is responsible for keeping this in sync with what it actually does.

Source
focus_left

Resets which pane is active back to the left one — for a host app that reuses the same SplitWindow instance across appearances (e.g. showing/hiding it based on runtime state) and wants a consistent starting focus each time it reappears, rather than carrying over whatever pane was last active before it was hidden.

Source
focus_right

Symmetric counterpart to #focus_left — for a host that collapses the left pane (e.g. width 0) and needs focus off it since it can no longer usefully hold keyboard input.

Source
handle_key(ev : KeyEvent) : Bool

Returns true if the key was consumed.

Source
left_width
Source
left_width=(w : Int32) : Nil

Width in columns of the left pane's content area, excluding the divider column. Adjustable at runtime (e.g. a draggable-divider feature) independent of #initialize's initial split.

Source
render

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.

Source
scrollbar_style

Applied to both panes' scrollbar track and thumb drawn by #render — 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.

Source
scrollbar_style=(style : Style) : Nil
Source
status_hint

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.

Source