Back to Projects
TUIX v0.5Beta

Last Updated: 2026-05-20

Python API Reference

This reference documents the stable public wrapper surface in tuix.core for v0.5. Each method entry explains how to call it and why the method exists.

Import Pattern

from tuix.core import engine, builders, registry, input, scenes, buffers, objects

Common Rules

  • Scene names, builder names, labels, and titles usually accept bytes or str.
  • Character arguments such as sym, fill, empty, left, and right accept one-byte bytes, one-character str, or an integer byte value.
  • Widget methods use obj_ptr. In normal code, get it once with objects.get_object_by_uid(uid) and reuse it.
  • Most setters return 0 on success and non-zero on failure. Snapshot getters return dict or None.
  • Compatibility feed_input methods remain for old code; current v0.5 apps should usually rely on input.listen() and engine.main_loop().

Coverage Map

ModuleDocumented SurfacePrimary Page
tuix.core.buildersBuilder constants, aliases, layout constants, and register_standard().Builders
tuix.core.engine7 lifecycle, frame, stats, and mouse-capture methods.Engine
tuix.core.input4 listener and snapshot methods.Input API
tuix.core.scenes16 lifecycle, selection, focus, modal, transaction, stats, and compaction methods.Scenes API
tuix.core.buffers12 hierarchy, z-index, layout override, grid placement, and snapshot methods.Buffers API
tuix.core.objectsObject lifecycle plus every widget, layout, viewport, and modal runtime method.Objects API
tuix.core.registryRegistryProxy and current_scene_name property.Registry
tuix.core._libInternal bridge helpers documented separately for debugging only.Internal API

Typical Boot Sequence

engine.init()
builders.register_standard()
scenes.init_scene('Main')
scenes.select_scene('Main')
input.listen()

uid = objects.create_object(builders.TEXT, 'Main', 0.5, 0.1, 0.1, 0.1)
obj = objects.get_object_by_uid(uid)
objects.tuix_text_set_text(obj, 'Ready')

engine.main_loop()
input.stop()
engine.shutdown()