build_tools.tui_common.controls
Shared UI Controls for Textual-based TUIs.
This module provides reusable UI widgets that can be used across multiple TUI applications. All widgets follow consistent patterns:
Communication Pattern:
Each widget posts a custom Message when its value changes:
@on(IntSpinner.Changed)
def handle_spinner(self, event: IntSpinner.Changed) -> None:
print(f"Widget {event.widget_id} changed to {event.value}")
Focus Pattern:
Widgets are focusable for keyboard navigation but use widget-level bindings that don’t conflict with app-level bindings.
Available Widgets:
FloatSlider- Float parameter adjustment with precision controlIntSpinner- Integer parameter adjustment with optional suffixSeedInput- Random seed input with two-box designRadioOption- Radio button style option selectionDirectoryBrowserScreen- Modal directory browser with validationJKSelect- Dropdown select with vim-style j/k navigation