TUIX v0.5Beta
Examples
The v0.5 repository includes runnable examples under examples/widgets, examples/multimodal, and examples/showcase. They demonstrate widgets, focus routing, buffer hierarchy, and scene stats.
Widget Examples
| File | Description |
|---|---|
| examples/widgets/progressbar_dual.py | Two bars filling at different speeds. |
| examples/widgets/choice_palette.py | Color palette menu that prints the selected RGB value. |
| examples/widgets/canvas_bounce.py | Animated bouncing ball with color cycling and FPS counter. |
| examples/widgets/text_and_box_demo.py | Text and box builder styling demo. |
| examples/widgets/button_and_badge_demo.py | Button and badge interaction demo. |
| examples/widgets/menu_and_tags_demo.py | Menu and tag widgets together. |
| examples/widgets/scroll_container_demo.py | Scroll container viewport demo. |
Multimodal And Showcase
| File | Description |
|---|---|
| examples/multimodal/focus_routing.py | Keyboard and mouse focus routing between choice and input. |
| examples/showcase/sequential_journey.py | Sequential demo: progressbar to choice to input to canvas. |
| examples/showcase/buffer_hierarchy_demo.py | Parent-child buffer hierarchy and z-index layering. |
| examples/showcase/scene_stats_demo.py | Scene stats snapshots and compaction APIs. |
Run An Example
python examples/widgets/canvas_bounce.pyRecommended Patterns
- Use scenes.set_focus(...) for keyboard routing when multiple interactive widgets are present.
- Use snapshot APIs for diagnostics instead of raw buffer pointer getters.
- Use layout builders and buffer slot APIs for nested composition rather than manually recalculating terminal geometry in Python.