module
TUI::DropdownPicker
Overview
Sizing/construction factory for a centered, content-sized Window hosting a searchable option list — the dropdown-picker counterpart to Popup.centered, except height tracks option count instead of a fixed single message line, and the "message" is an interactive list rather than static text. Push the returned Window via NavStack#push directly (same escape hatch Popup itself documents and uses), not Runtime#push, so it keeps this computed size instead of being forced full-screen.
Defined in:
tui/widgets/dropdown_picker.crConstant Summary
-
DEFAULT_MAX_HEIGHT =
12 -
Default upper bound on the popup's height in rows, before the screen-size clamp in #build_window — keeps a picker with many options from growing to fill the whole screen. Override via
.centered/.centered_multi'smax_heightfor a taller popup.
Class Method Summary
- .centered(screen : Screen, title : String, options : Array(FormEnumOption), initial_index : Int32 = 0, max_height : Int32 = DEFAULT_MAX_HEIGHT) : NamedTuple(window: Window, list: OptionListView)
- .centered_multi(screen : Screen, title : String, options : Array(FormEnumOption), initial : Set(String), max_height : Int32 = DEFAULT_MAX_HEIGHT) : NamedTuple(window: Window, list: MultiOptionListView)
Class Method Detail
def self.centered(screen : Screen, title : String, options : Array(FormEnumOption), initial_index : Int32 = 0, max_height : Int32 = DEFAULT_MAX_HEIGHT) : NamedTuple(window: Window, list: OptionListView)
#
def self.centered_multi(screen : Screen, title : String, options : Array(FormEnumOption), initial : Set(String), max_height : Int32 = DEFAULT_MAX_HEIGHT) : NamedTuple(window: Window, list: MultiOptionListView)
#