class

TUI::ListView

Inherits TUI::Scrollable < Reference < Object

Constructors

new(source : ListDataSource)
Source

Instance methods

content_size

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

Source
cursor_focused_style

Layered (via Term.overlay) onto the cursor row when this list is focused — see #render_content.

Source
cursor_focused_style=(cursor_focused_style : Style)

Layered (via Term.overlay) onto the cursor row when this list is focused — see #render_content.

Source
cursor_unfocused_style

Layered onto the cursor row when this list is NOT focused — a weaker cue than #cursor_focused_style, so cursor position still shows without implying the list is active.

Source
cursor_unfocused_style=(cursor_unfocused_style : Style)

Layered onto the cursor row when this list is NOT focused — a weaker cue than #cursor_focused_style, so cursor position still shows without implying the list is active.

Source
filter_active?

Whether the filter/search input is currently capturing keystrokes. A host app dispatching its own global key menu on top of this widget should skip that dispatch entirely while this is true — otherwise a global single-char binding (e.g. a "m" or "q" shortcut) hijacks a keystroke the user is typing into the filter text instead of it being appended to the filter.

Source
filter_prompt_style

Applied to the /filter prompt line while filtering is active.

Source
filter_prompt_style=(filter_prompt_style : Style)

Applied to the /filter prompt line while filtering is active.

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

Satisfies Scrollable#header_rows by delegating to #content_row_offset — kept as one method, not two independently-set numbers, so Window's scroll-viewport math can never disagree with where #render_content actually starts drawing data rows.

Source
on_activate

Fires with the selected row's index on Enter or a confirmed click (see ClickTracker) — the "open/commit this row" signal, distinct from #on_select's continuous highlight tracking.

Source
on_activate=(on_activate : Proc(Int32, Nil) | Nil)

Fires with the selected row's index on Enter or a confirmed click (see ClickTracker) — the "open/commit this row" signal, distinct from #on_select's continuous highlight tracking.

Source
on_select

Fires with the newly-current row's index whenever the cursor moves (arrows, page keys, mouse wheel, click, filtering, sort change, #reload) — a live "what's highlighted right now" signal, e.g. for driving a detail pane alongside the list.

Source
on_select=(on_select : Proc(Int32, Nil) | Nil)

Fires with the newly-current row's index whenever the cursor moves (arrows, page keys, mouse wheel, click, filtering, sort change, #reload) — a live "what's highlighted right now" signal, e.g. for driving a detail pane alongside the list.

Source
reload
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
row_content(index : Int32) : String

The content string for content-row index, before the leading " {pointer}" prefix and before width-fitting/highlight styling (those stay in render_content, shared by every subclass).

Source
selected_index
Source
status_hint
Source
title
Source
title_style

Applied to #title's text when this list is focused (see #title).

Source
title_style=(title_style : Style)

Applied to #title's text when this list is focused (see #title).

Source

Macros

scroll(header)

Declares how many rows this ListView subclass reserves above its data rows (e.g. a table's column header), as a bare class-body statement: scroll header: 1. Expands to the #content_row_offset override — the single source of truth #render_content and Scrollable#header_rows (queried by Window to keep scroll/cursor math from running past what's actually drawable) both read from.

Source