Back to Projects
TUIX v0.2.0Beta

Last Updated: 2026-05-20

Registry API

The registry module (tuix.core.registry) provides access to the global TuixRegistry, which holds the active scene name, terminal dimensions, and pointers to all scenes, subcycles, and builders.

registry.registry

The global registry object. On platforms where the C registry symbol is directly available, this is the actual TuixRegistry struct. On Windows (where the symbol is not exported), a RegistryProxy object is used instead.

current_scene_name

from tuix.core import registry

# Set the active scene
registry.registry.current_scene_name = b"main"

# Read the active scene name
name = registry.registry.current_scene_name
PropertyTypeDescription
current_scene_namebytesName of the currently active scene. Only this scene is rendered.

Setting this property changes which scene is rendered on the next call to engine.main_loop(). The setter accepts both bytes and str (str values are auto-encoded to bytes). Internally, the setter prefers tuix_select_scene() for pointer-based lookup, falling back to direct attribute assignment.

Terminal Dimensions

The registry tracks current and previous terminal dimensions, updated every frame. These are read-only values reflecting the state as of the last main_loop() call.

FieldTypeDescription
terminal_widthintCurrent terminal width in columns
terminal_heightintCurrent terminal height in rows
terminal_width_oldintPrevious frame's terminal width
terminal_height_oldintPrevious frame's terminal height
Resize DetectionThe engine compares terminal_width/height against terminal_width_old/height_old each frame. When a change is detected, all widget geometries are recalculated and a full redraw is triggered.