build_tools.syllable_walk_tui.core.handlers
Event handler routing for Syllable Walker TUI.
Contains handler dispatch logic extracted from the main App class. The actual @on() decorated methods remain on the App, but delegate here.
This module provides pure functions that take the app instance and event data, then route to appropriate state updates. This separation allows: - Testing of handler logic without full App setup - Clearer separation of concerns - Easier maintenance and modification
Functions
|
Switch patch to custom mode when user manually adjusts profile parameters. |
|
Route IntSpinner.Changed events to appropriate state updates. |
|
Route FloatSlider.Changed events to appropriate state updates. |
|
Route SeedInput.Changed events to appropriate state updates. |
|
Handle selector mode radio option selection. |
|
Set selector count mode and update radio button UI. |
|
Handle selector count mode radio selection. |
|
Set combiner syllable mode and update radio button UI. |
|
Handle combiner mode radio option selection. |
|
Handle selector order radio option selection. |
|
Handle selector name class selection change. |
|
Handle profile option selection (radio button click). |
Module Contents
- build_tools.syllable_walk_tui.core.handlers.switch_to_custom_mode(app, patch_name, patch)[source]
Switch patch to custom mode when user manually adjusts profile parameters.
This is called when the user manually changes max_flips, temperature, or frequency_weight - the three parameters that define walk profiles. When manually adjusted, the patch switches from a named profile to “custom” mode.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for widget queries
patch_name (str) – “A” or “B”
patch (build_tools.syllable_walk_tui.modules.oscillator.PatchState) – PatchState instance to update
Note
Only switches to custom if currently using a named profile. If already in custom mode, does nothing.
- build_tools.syllable_walk_tui.core.handlers.handle_int_spinner_changed(app, widget_id, value)[source]
Route IntSpinner.Changed events to appropriate state updates.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state access
widget_id (str) – Widget ID from the event
value (int) – New value from the spinner
- build_tools.syllable_walk_tui.core.handlers.handle_float_slider_changed(app, widget_id, value)[source]
Route FloatSlider.Changed events to appropriate state updates.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state access
widget_id (str) – Widget ID from the event
value (float) – New value from the slider
- build_tools.syllable_walk_tui.core.handlers.handle_seed_changed(app, widget_id, value)[source]
Route SeedInput.Changed events to appropriate state updates.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state access
widget_id (str) – Widget ID from the event
value (int) – New seed value
- build_tools.syllable_walk_tui.core.handlers.handle_selector_mode_selected(app, widget_id, mode)[source]
Handle selector mode radio option selection.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state and widget access
widget_id (str) – Widget ID like “selector-mode-hard-a”
mode (str) – Mode name (“hard” or “soft”)
- build_tools.syllable_walk_tui.core.handlers.set_selector_count_mode(app, patch_name, selector, mode)[source]
Set selector count mode and update radio button UI.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for widget access
patch_name (str) – “A” or “B”
selector (build_tools.syllable_walk_tui.modules.generator.SelectorState) – SelectorState instance
mode (str) – “manual” or “unique”
- build_tools.syllable_walk_tui.core.handlers.handle_selector_count_mode_selected(app, widget_id, mode)[source]
Handle selector count mode radio selection.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state and widget access
widget_id (str) – Widget ID like “selector-count-mode-unique-a”
mode (str) – Mode name (“manual” or “unique”)
- build_tools.syllable_walk_tui.core.handlers.set_combiner_mode(app, patch_name, combiner, mode)[source]
Set combiner syllable mode and update radio button UI.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for widget access
patch_name (str) – “A” or “B”
combiner (build_tools.syllable_walk_tui.modules.generator.CombinerState) – CombinerState instance
mode (str) – “exact” or “all”
- build_tools.syllable_walk_tui.core.handlers.handle_combiner_mode_selected(app, widget_id, mode)[source]
Handle combiner mode radio option selection.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state and widget access
widget_id (str) – Widget ID like “combiner-mode-all-a”
mode (str) – Mode name (“exact” or “all”)
- build_tools.syllable_walk_tui.core.handlers.handle_selector_order_selected(app, widget_id, order)[source]
Handle selector order radio option selection.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state and widget access
widget_id (str) – Widget ID like “selector-order-random-a”
order (str) – Order name (“random” or “alphabetical”)
- build_tools.syllable_walk_tui.core.handlers.handle_selector_name_class_changed(app, widget_id, value)[source]
Handle selector name class selection change.
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state access
widget_id (str) – Widget ID like “selector-name-class-a”
value (str) – Selected name class
- build_tools.syllable_walk_tui.core.handlers.handle_profile_selected(app, widget_id, profile_name)[source]
Handle profile option selection (radio button click).
- Parameters:
app (build_tools.syllable_walk_tui.core.app.SyllableWalkerApp) – Application instance for state and widget access
widget_id (str) – Widget ID like “profile-clerical-A”
profile_name (str) – Name of the selected profile