TUIX v0.6Beta
Examples & Demos
The repository includes runnable sample applications under examples/widgets, examples/multimodal, and examples/showcase. They demonstrate all 22 built-in widgets, focus routing, buffer hierarchies, modal dialogs, and scene compaction.
Widget Examples
| File | Description |
|---|---|
| examples/widgets/progressbar_dual.py | Two animated progress bars filling at different speeds with custom fill characters. |
| examples/widgets/choice_palette.py | Interactive color palette selector demonstrating choice confirmation and keyboard navigation. |
| examples/widgets/canvas_bounce.py | Real-time bouncing ball graphic with Bresenham line rendering and FPS counter. |
| examples/widgets/text_and_box_demo.py | Typography styling, bold/italic text attributes, and custom box borders. |
| examples/widgets/button_and_badge_demo.py | Button press detection, transparent backgrounds, and status badges. |
| examples/widgets/scroll_container_demo.py | Virtual content scroll container with keyboard and mouse scroll offset navigation. |
Multimodal & Showcase Demos
| File | Description |
|---|---|
| examples/multimodal/focus_routing.py | Seamless keyboard and mouse focus transitions between interactive Choice, Input, and Button widgets. |
| examples/showcase/sequential_journey.py | Sequential multistep wizard workflow demonstrating scenes, progressbars, input forms, and canvas charts. |
| examples/showcase/buffer_hierarchy_demo.py | Parent-child buffer tree compositions, relative offsets, and z-index layering. |
| examples/showcase/scene_stats_demo.py | Scene memory metrics, buffer counts, and cold-scene compaction lifecycle. |
Running An Example
python examples/widgets/canvas_bounce.pyRecommended v0.6 Best Practices
- Use modular subpackage imports: from tuix.core import scene, object as objects, buffer, content_builder, input, core.
- Pass byte literals for scene identifiers: b'Main', b'Overlay', etc.
- Use scene.set_focus(b'Main', uid) for explicit keyboard routing across focusable components.
- Use buffer snapshot APIs (get_buffer_snapshot_by_uid) for UI testing and diagnostics rather than low-level pointer inspection.