Back to Projects
TUIX v0.6Beta

Last Updated: 2026-08-14

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

FileDescription
examples/widgets/progressbar_dual.pyTwo animated progress bars filling at different speeds with custom fill characters.
examples/widgets/choice_palette.pyInteractive color palette selector demonstrating choice confirmation and keyboard navigation.
examples/widgets/canvas_bounce.pyReal-time bouncing ball graphic with Bresenham line rendering and FPS counter.
examples/widgets/text_and_box_demo.pyTypography styling, bold/italic text attributes, and custom box borders.
examples/widgets/button_and_badge_demo.pyButton press detection, transparent backgrounds, and status badges.
examples/widgets/scroll_container_demo.pyVirtual content scroll container with keyboard and mouse scroll offset navigation.

Multimodal & Showcase Demos

FileDescription
examples/multimodal/focus_routing.pySeamless keyboard and mouse focus transitions between interactive Choice, Input, and Button widgets.
examples/showcase/sequential_journey.pySequential multistep wizard workflow demonstrating scenes, progressbars, input forms, and canvas charts.
examples/showcase/buffer_hierarchy_demo.pyParent-child buffer tree compositions, relative offsets, and z-index layering.
examples/showcase/scene_stats_demo.pyScene memory metrics, buffer counts, and cold-scene compaction lifecycle.

Running An Example

python examples/widgets/canvas_bounce.py

Recommended 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.