Objects API The objects module is the largest public runtime surface. It creates objects, resolves object handles by UID, and exposes every widget, layout, viewport, and modal operation.
Object Handles Most methods take obj_ptr. In normal application code, call objects.get_object_by_uid(uid) once and reuse the returned handle.
Common Creation Pattern uid = objects.create_object(builders.BUTTON, 'Main', 0.25, 0.08, 0.1, 0.1)
button = objects.get_object_by_uid(uid)
objects.tuix_button_set_label(button, 'Run')Core Object Lifecycle Method How to use it Why it exists objects.create_object(builder_name, scene_name, width_mod, height_mod, margin_top_mod, margin_left_mod) -> int Create any widget or layout object in a scene. Allocates the native object plus its buffer and returns the UID used by later APIs. objects.get_object_by_uid(uid: int) Call once after creation and reuse the returned handle for widget methods. Converts a UID into the object handle expected by typed widget functions. objects.get_object_snapshot_by_uid(uid: int) -> dict | None Read object geometry modifiers for diagnostics. Provides safe read-only inspection without relying on raw native pointers.
uid = objects.create_object(builders.TEXT, 'Main', 0.4, 0.1, 0.05, 0.05)
obj = objects.get_object_by_uid(uid)
snapshot = objects.get_object_snapshot_by_uid(uid)Progressbar Method How to use it Why it exists objects.tuix_progressbar_set_value(obj_ptr, value: float) -> int Set value between 0.0 and 1.0. Updates the visual fill amount. objects.tuix_progressbar_get_value(obj_ptr) -> float Read the current progress value. Lets app code synchronize progress state or display external labels. objects.tuix_progressbar_set_style(obj_ptr, fill, empty, fr, fg, fb, er, eg, eb) -> int Set fill/empty characters and RGB colors. Separates progress state from visual styling. objects.tuix_progressbar_show_percentage(obj_ptr, show=True) -> None Enable or disable percentage overlay text. Provides a built-in readable value display without a separate text widget.
bar = objects.get_object_by_uid(uid)
objects.tuix_progressbar_set_value(bar, 0.75)
objects.tuix_progressbar_show_percentage(bar, True)Choice Method How to use it Why it exists objects.tuix_choice_set_options(obj_ptr, labels) -> int Pass a list of str or bytes option labels. Defines the selectable items rendered by the widget. objects.tuix_choice_feed_input(obj_ptr, snap) -> int Use only for legacy/manual input flows. Keeps old code working; normal v0.5 routing handles input automatically. objects.tuix_choice_is_confirmed(obj_ptr) -> int Check after engine.main_loop() to know if selection was confirmed. Exposes semantic confirmation state without inspecting key events. objects.tuix_choice_get_result(obj_ptr) -> int Read the confirmed option index. Returns the committed choice for application logic. objects.tuix_choice_get_selected(obj_ptr) -> int Read the currently highlighted option. Supports live previews or status displays while navigating. objects.tuix_choice_reset(obj_ptr) -> None Clear confirmation state after handling it. Allows the same widget to be reused for repeated choices.
objects.tuix_choice_set_options(choice, ['One', 'Two'])
if objects.tuix_choice_is_confirmed(choice):
result = objects.tuix_choice_get_result(choice)
objects.tuix_choice_reset(choice)Method How to use it Why it exists objects.tuix_input_set_placeholder(obj_ptr, text) -> int Set text shown when the field is empty. Gives users context without external labels. objects.tuix_input_feed_input(obj_ptr, snap) -> int Use only for legacy/manual input flows. Keeps compatibility with older explicit snapshot feeding. objects.tuix_input_is_submitted(obj_ptr) -> int Check after frames to detect Enter/submit. Turns raw key handling into semantic submitted state. objects.tuix_input_get_result(obj_ptr) -> bytes | None Read the submitted text after submit. Returns the committed value for forms and prompts. objects.tuix_input_get_text(obj_ptr) -> bytes Read the current text while editing. Supports live validation or mirrored UI. objects.tuix_input_reset(obj_ptr) -> None Clear submitted state after handling. Lets the same input field continue accepting values.
objects.tuix_input_set_placeholder(field, 'Name')
if objects.tuix_input_is_submitted(field):
value = objects.tuix_input_get_result(field)Canvas Method How to use it Why it exists objects.tuix_canvas_set_pixel(obj_ptr, x, y, sym, fgr, fgg, fgb, bgr, bgg, bgb) -> int Write one styled cell at canvas coordinates. Provides the smallest drawing primitive. objects.tuix_canvas_draw_line(obj_ptr, x0, y0, x1, y1, sym, fgr, fgg, fgb, bgr, bgg, bgb) -> int Draw a straight line between two points. Avoids hand-rolling line rasterization in Python. objects.tuix_canvas_draw_rect(obj_ptr, x, y, w, h, sym, filled, fgr, fgg, fgb, bgr, bgg, bgb) -> int Draw an outline or filled rectangle. Provides common panel/chart primitives efficiently. objects.tuix_canvas_draw_circle(obj_ptr, cx, cy, radius, sym, filled, fgr, fgg, fgb, bgr, bgg, bgb) -> int Draw an outline or filled circle. Provides a native primitive for indicators and simple graphics. objects.tuix_canvas_draw_text(obj_ptr, x, y, text, fgr, fgg, fgb, bgr, bgg, bgb) -> int Draw text inside the canvas. Lets drawings include labels without separate text widgets. objects.tuix_canvas_draw_sprite(obj_ptr, dst_x, dst_y, sprite_w, sprite_h, sprite_ptr) -> int Draw raw native sprite pixels. Supports advanced integrations that prepare pixel memory externally. objects.tuix_canvas_insert_buffer(obj_ptr, pixels_ptr, size) -> int Insert raw pixel memory into the canvas. Allows bulk updates from native or generated buffers. objects.tuix_canvas_cache_sprite(obj_ptr, sprite_w, sprite_h, sprite_ptr) -> int Cache a sprite and keep the returned sprite ID. Avoids re-uploading repeated sprite pixel data. objects.tuix_canvas_free_cached_sprite(obj_ptr, sprite_id) -> None Free a sprite ID created by cache_sprite. Releases native sprite memory when it is no longer needed. objects.tuix_canvas_draw_cached_sprite(obj_ptr, sprite_id, dst_x, dst_y) -> int Draw an already cached sprite by ID. Makes repeated sprite drawing cheaper.
objects.tuix_canvas_draw_rect(canvas, 1, 1, 20, 5, '#', 0, 120, 220, 255, 0, 0, 0)
objects.tuix_canvas_draw_text(canvas, 3, 3, 'TUIX', 255, 255, 255, 0, 0, 0)Text Method How to use it Why it exists objects.tuix_text_set_text(obj_ptr, text) -> int Set the displayed text. Updates label/content without recreating the widget. objects.tuix_text_set_fg(obj_ptr, r, g, b) -> int Set foreground RGB color. Allows dynamic semantic coloring. objects.tuix_text_set_bg(obj_ptr, r, g, b) -> int Set background RGB color. Highlights text without wrapping it in another widget. objects.tuix_text_clear_bg(obj_ptr) -> int Remove custom background color. Returns text to transparent/default background behavior.
objects.tuix_text_set_text(label, 'Ready')
objects.tuix_text_set_fg(label, 120, 220, 160)Box Method How to use it Why it exists objects.tuix_box_set_title(obj_ptr, title) -> int Set the box title. Labels framed regions without extra widgets. objects.tuix_box_set_colors(obj_ptr, border_r, border_g, border_b, bg_r, bg_g, bg_b) -> int Set border and background RGB colors. Controls panel styling from application state. objects.tuix_box_set_color(obj_ptr, r, g, b) -> int Use as compatibility helper for simple border color changes. Keeps older code working while set_colors is the richer API. objects.tuix_box_set_border(obj_ptr, enabled) -> int Use as compatibility toggle for border behavior. Preserves API continuity for older box examples.
objects.tuix_box_set_title(box, 'Panel')
objects.tuix_box_set_colors(box, 80, 120, 220, 20, 24, 32)Divider Method How to use it Why it exists objects.tuix_divider_set_orientation(obj_ptr, vertical) -> int Set horizontal/vertical orientation using 0/1 or axis constants. Lets one builder render separators in either direction. objects.tuix_divider_set_symbol(obj_ptr, sym) -> int Set the divider character. Supports visual styles such as line, dash, or custom glyph. objects.tuix_divider_set_color(obj_ptr, r, g, b) -> int Set divider RGB color. Separates layout structure from color semantics.
objects.tuix_divider_set_orientation(divider, builders.AXIS_VERTICAL)
objects.tuix_divider_set_symbol(divider, '|')Badge Method How to use it Why it exists objects.tuix_badge_set_text(obj_ptr, text) -> int Set compact badge label. Updates status chips without rebuilding UI. objects.tuix_badge_set_colors(obj_ptr, fr, fg, fb, br, bg, bb) -> int Set foreground and background RGB colors. Encodes categories such as beta, warning, or success.
objects.tuix_badge_set_text(badge, 'BETA')
objects.tuix_badge_set_colors(badge, 255,255,255, 90,80,220)Method How to use it Why it exists objects.tuix_button_set_label(obj_ptr, label) -> int Set visible button text. Separates button identity from layout and input state. objects.tuix_button_take_pressed(obj_ptr) -> int Read and consume press state after frames. Prevents handling the same press repeatedly. objects.tuix_button_reset(obj_ptr) -> None Clear pressed state manually. Gives explicit control for custom interaction flows. objects.tuix_button_feed_input(obj_ptr, snap) -> int Use only for legacy/manual input flows. Keeps older manual snapshot code working. objects.tuix_button_is_pressed(obj_ptr) -> int Compatibility alias for take_pressed. Preserves older naming used by examples. objects.tuix_button_get_state(obj_ptr) -> int Compatibility alias for take_pressed. Preserves older state-query naming.
if objects.tuix_button_take_pressed(button):
run_action()Tag Method How to use it Why it exists objects.tuix_tag_set_text(obj_ptr, text) -> int Set tag label. Represents compact labels such as filters or categories. objects.tuix_tag_set_brackets(obj_ptr, left, right) -> int Set left and right bracket characters. Lets tags match different visual languages. objects.tuix_tag_set_colors(obj_ptr, fr, fg, fb, br, bg, bb) -> int Set foreground and background colors. Styles tags by type or state.
objects.tuix_tag_set_text(tag, 'active')
objects.tuix_tag_set_brackets(tag, '[', ']')Status Method How to use it Why it exists objects.tuix_status_set_text(obj_ptr, text) -> int Set status label text. Keeps human-readable status separate from numeric level. objects.tuix_status_set_level(obj_ptr, level) -> int Set current status level. Selects the color/state rendering for IDLE/OK/WARN/ERROR style statuses. objects.tuix_status_set_palette(obj_ptr, ok_r, ok_g, ok_b, warn_r, warn_g, warn_b, err_r, err_g, err_b, idle_r, idle_g, idle_b) -> int Set the full status color palette. Lets applications align status colors with their domain. objects.tuix_status_set_status(obj_ptr, status) -> int Compatibility alias for set_level. Preserves older status naming while canonical API uses level.
objects.tuix_status_set_text(status, 'Connected')
objects.tuix_status_set_level(status, 1)Method How to use it Why it exists objects.tuix_menu_set_title(obj_ptr, title) -> int Set the menu title. Labels a menu region without an external text widget. objects.tuix_menu_set_items(obj_ptr, labels) -> int Set menu item labels. Defines the selectable menu model. objects.tuix_menu_set_options(obj_ptr, labels) -> int Compatibility alias for set_items. Keeps older option-based naming working. objects.tuix_menu_feed_input(obj_ptr, snap) -> int Use only for legacy/manual input flows. Preserves explicit snapshot feeding for old code. objects.tuix_menu_get_selected(obj_ptr) -> int Read highlighted item index. Supports previews and status mirrors during navigation. objects.tuix_menu_take_activated(obj_ptr) -> int Read and consume activated item index. Prevents repeated handling of one activation. objects.tuix_menu_is_activated(obj_ptr) -> int Compatibility helper derived from take_activated. Preserves older boolean activation checks. objects.tuix_menu_reset(obj_ptr) -> None Clear activation state. Allows menu reuse after handling an action.
objects.tuix_menu_set_items(menu, ['Open', 'Save'])
activated = objects.tuix_menu_take_activated(menu)Method How to use it Why it exists objects.tuix_scroll_container_is_viewport(obj_ptr) -> int Check whether a scroll container acts as a viewport. Confirms viewport behavior for diagnostics or wrappers. objects.tuix_scroll_container_get_viewport_offset(obj_ptr) -> tuple[int, int] | None Read viewport offset as (offset_x, offset_y). Exposes scroll position in the compositor viewport contract. objects.tuix_scroll_container_get_viewport_insets(obj_ptr) -> tuple[int, int, int, int] | None Read viewport insets. Lets child layout account for borders/title padding. objects.tuix_scroll_container_set_title(obj_ptr, title) -> int Set scroll container title. Labels scrollable regions. objects.tuix_scroll_container_set_content_size(obj_ptr, width, height) -> int Set virtual content dimensions in cells. Defines the scrollable coordinate space. objects.tuix_scroll_container_set_offset(obj_ptr, offset_x, offset_y) -> int Set current scroll offset. Moves the viewport over virtual content. objects.tuix_scroll_container_get_offset_x(obj_ptr) -> int Read horizontal scroll offset. Supports scroll indicators or synchronized panes. objects.tuix_scroll_container_get_offset_y(obj_ptr) -> int Read vertical scroll offset. Supports scroll indicators or lazy loading. objects.tuix_scroll_container_get_content_width(obj_ptr) -> int Read virtual content width. Lets wrappers and UI calculate scroll bounds. objects.tuix_scroll_container_get_content_height(obj_ptr) -> int Read virtual content height. Lets wrappers and UI calculate scroll bounds. objects.tuix_scroll_container_add_object(obj_ptr, scene_name, builder_name, width_mod, height_mod, margin_top_mod, margin_left_mod) -> int Create and attach a proportional child object. Combines object creation and parent attachment for scroll containers. objects.tuix_scroll_container_attach_child(obj_ptr, scene_name, child_uid) -> int Attach an existing child UID. Allows composing existing widgets inside a viewport. objects.tuix_scroll_container_detach_child(obj_ptr, scene_name, child_uid) -> int Detach an existing child UID. Supports dynamic viewport content without freeing the child. objects.tuix_scroll_container_add_object_at(obj_ptr, scene_name, builder_name, content_x, content_y, content_w, content_h) -> int Create a child at virtual content coordinates. Places children in scroll content space rather than terminal fractions. objects.tuix_scroll_container_feed_input(obj_ptr, snap) -> int Use only for legacy/manual input flows. Preserves older explicit input routing code. objects.tuix_scroll_container_get_scroll_pos(obj_ptr) -> int Compatibility alias for vertical scroll position. Keeps older examples working while offset_y is canonical.
objects.tuix_scroll_container_set_content_size(scroll, 120, 200)
objects.tuix_scroll_container_set_offset(scroll, 0, 20)
child_uid = objects.tuix_scroll_container_add_object_at(scroll, 'Main', builders.TEXT, 2, 25, 40, 1)Checkbox Method How to use it Why it exists objects.tuix_checkbox_set_label(obj_ptr, label) -> int Set checkbox label. Provides readable meaning for the toggle. objects.tuix_checkbox_set_checked(obj_ptr, checked) -> int Set checked state explicitly. Synchronizes widget state from application data. objects.tuix_checkbox_get_checked(obj_ptr) -> int Read current checked state. Lets application logic consume toggle state. objects.tuix_checkbox_toggle(obj_ptr) -> int Toggle checked state programmatically. Supports keyboard shortcuts or external commands. objects.tuix_checkbox_take_changed(obj_ptr) -> int Read and consume changed flag. Prevents repeated handling of one state change. objects.tuix_checkbox_set_disabled(obj_ptr, disabled) -> int Enable or disable user interaction. Lets forms express unavailable options without removing them.
objects.tuix_checkbox_set_label(box, 'Enable cache')
if objects.tuix_checkbox_take_changed(box):
enabled = bool(objects.tuix_checkbox_get_checked(box))ListView Method How to use it Why it exists objects.tuix_listview_set_title(obj_ptr, title) -> int Set list title. Labels the virtual list region. objects.tuix_listview_set_items(obj_ptr, items) -> int Set list item labels. Defines virtual list content. objects.tuix_listview_set_selected(obj_ptr, index) -> int Set selected item index. Synchronizes selection from app state or shortcuts. objects.tuix_listview_get_selected(obj_ptr) -> int Read selected item index. Feeds application previews or detail panes. objects.tuix_listview_take_activated(obj_ptr) -> int Read and consume activated item index. Turns enter/double-click style activation into one-shot app events.
objects.tuix_listview_set_items(listview, ['Alpha', 'Beta'])
selected = objects.tuix_listview_get_selected(listview)
activated = objects.tuix_listview_take_activated(listview)TextArea Method How to use it Why it exists objects.tuix_textarea_set_title(obj_ptr, title) -> int Set text area title. Labels the multiline editor region. objects.tuix_textarea_set_text(obj_ptr, text) -> int Replace full text content. Synchronizes editor state from files or app data. objects.tuix_textarea_get_text(obj_ptr) -> bytes Read full current text. Lets the application save or validate edited content. objects.tuix_textarea_set_placeholder(obj_ptr, text) -> int Set placeholder text for empty content. Guides users before they type. objects.tuix_textarea_set_readonly(obj_ptr, readonly) -> int Toggle read-only mode. Allows the same widget to serve as viewer or editor.
objects.tuix_textarea_set_text(area, 'Line one
Line two')
text = objects.tuix_textarea_get_text(area)Dialog Method How to use it Why it exists objects.tuix_dialog_attach_child(obj_ptr, scene_name, child_uid) -> int Attach an existing child inside the dialog body. Composes dialog content from normal widgets. objects.tuix_dialog_detach_child(obj_ptr, scene_name, child_uid) -> int Detach a dialog child. Supports dynamic modal content without destroying the child. objects.tuix_dialog_add_object(obj_ptr, scene_name, builder_name, width_mod, height_mod) -> int Create a child object in the dialog body. Combines child creation and dialog attachment. objects.tuix_dialog_set_title(obj_ptr, title) -> int Set dialog title. Provides context for modal content. objects.tuix_dialog_set_body_size(obj_ptr, width, height) -> int Set body dimensions in terminal cells. Controls modal content space independently from proportional outer geometry. objects.tuix_dialog_set_padding(obj_ptr, left, top, right, bottom) -> int Set dialog body padding. Keeps child content away from borders and title regions. objects.tuix_dialog_set_close_on_esc(obj_ptr, enabled) -> int Enable Escape close requests. Provides expected modal keyboard behavior. objects.tuix_dialog_set_close_on_backdrop(obj_ptr, enabled) -> int Enable close requests from backdrop clicks. Provides expected pointer behavior for modal overlays. objects.tuix_dialog_set_colors(obj_ptr, backdrop_r, backdrop_g, backdrop_b, border_r, border_g, border_b, body_r, body_g, body_b) -> int Set backdrop, border, and body colors. Lets modal UI match app tone and semantic state. objects.tuix_dialog_activate(obj_ptr, scene_name) -> int Activate the dialog as scene modal. Connects dialog widget state to scene modal routing. objects.tuix_dialog_deactivate(obj_ptr, scene_name) -> int Deactivate the dialog modal state. Restores normal scene input/focus routing. objects.tuix_dialog_take_close_requested(obj_ptr) -> int Read and consume close-request flag. Lets app decide whether to close, validate, or cancel a modal.
objects.tuix_dialog_activate(dialog, 'Main')
if objects.tuix_dialog_take_close_requested(dialog):
objects.tuix_dialog_deactivate(dialog, 'Main')Stack Layout: Row And Column Method How to use it Why it exists objects.tuix_stack_attach_child(obj_ptr, scene_name, child_uid) -> int Attach an existing child to Row or Column. Builds nested layout from already-created widgets. objects.tuix_stack_detach_child(obj_ptr, scene_name, child_uid) -> int Detach a child from Row or Column. Supports dynamic layout membership. objects.tuix_stack_add_object(obj_ptr, scene_name, builder_name, width_mod, height_mod) -> int Create and attach a child object. Combines common creation and attachment steps. objects.tuix_stack_set_gap(obj_ptr, gap) -> int Set cells between children. Controls spacing without manually offsetting children. objects.tuix_stack_set_padding(obj_ptr, left, top, right, bottom) -> int Set inner padding. Reserves space around children inside the container. objects.tuix_stack_set_justify(obj_ptr, justify) -> int Set main-axis distribution using builders.JUSTIFY_*. Controls how extra space is distributed. objects.tuix_stack_set_align(obj_ptr, align) -> int Set cross-axis alignment using builders.ALIGN_*. Controls child placement perpendicular to layout direction. objects.tuix_stack_set_bg(obj_ptr, r, g, b) -> int Set stack background color. Lets layout containers render as panels or bands. objects.tuix_stack_clear_bg(obj_ptr) -> int Clear custom stack background. Returns container to transparent/default background.
row_uid = objects.create_object(builders.ROW, 'Main', 0.9, 0.2, 0.05, 0.05)
row = objects.get_object_by_uid(row_uid)
objects.tuix_stack_set_gap(row, 2)
child_uid = objects.tuix_stack_add_object(row, 'Main', builders.TEXT, 1.0, 1.0)SplitPane Layout Method How to use it Why it exists objects.tuix_splitpane_attach_child(obj_ptr, scene_name, child_uid) -> int Attach an existing pane child. Builds split layouts from existing widgets. objects.tuix_splitpane_detach_child(obj_ptr, scene_name, child_uid) -> int Detach a pane child. Supports dynamic pane replacement. objects.tuix_splitpane_add_object(obj_ptr, scene_name, builder_name, width_mod, height_mod) -> int Create and attach a pane child. Combines common split-pane child setup. objects.tuix_splitpane_set_orientation(obj_ptr, orientation) -> int Set horizontal or vertical split using builders.AXIS_*. Controls whether panes divide width or height. objects.tuix_splitpane_set_split_ratio(obj_ptr, ratio) -> int Set divider by normalized ratio. Keeps pane split proportional across terminal resizes. objects.tuix_splitpane_set_split_pixels(obj_ptr, pixels) -> int Set divider by absolute cell count. Supports fixed-size sidebars or detail panes. objects.tuix_splitpane_set_divider_size(obj_ptr, divider_size) -> int Set divider thickness in cells. Controls interaction target and visual separation. objects.tuix_splitpane_set_min_sizes(obj_ptr, min_first, min_second) -> int Set minimum pane sizes. Prevents panes from collapsing below usable dimensions. objects.tuix_splitpane_set_colors(obj_ptr, divider_fg_r, divider_fg_g, divider_fg_b, divider_bg_r, divider_bg_g, divider_bg_b, bg_r, bg_g, bg_b) -> int Set divider and background colors. Styles split containers and their divider affordance. objects.tuix_splitpane_clear_bg(obj_ptr) -> int Clear custom background color. Returns splitpane to transparent/default background.
objects.tuix_splitpane_set_orientation(split, builders.AXIS_HORIZONTAL)
objects.tuix_splitpane_set_split_ratio(split, 0.35)
objects.tuix_splitpane_set_min_sizes(split, 10, 10)Grid Layout Method How to use it Why it exists objects.tuix_grid_attach_child(obj_ptr, scene_name, child_uid) -> int Attach an existing child to the grid. Adds widgets to native grid placement. objects.tuix_grid_detach_child(obj_ptr, scene_name, child_uid) -> int Detach a child from the grid. Supports dynamic grid contents. objects.tuix_grid_add_object(obj_ptr, scene_name, builder_name, width_mod, height_mod) -> int Create and attach a grid child. Combines object creation and grid membership. objects.tuix_grid_set_columns(obj_ptr, tracks) -> int Set column tracks as fixed or weighted specs. Defines horizontal layout math for children. objects.tuix_grid_set_rows(obj_ptr, tracks) -> int Set row tracks as fixed or weighted specs. Defines vertical layout math for children. objects.tuix_grid_set_padding(obj_ptr, left, top, right, bottom) -> int Set grid inner padding. Reserves space between grid border and child cells. objects.tuix_grid_set_gaps(obj_ptr, gap_x, gap_y) -> int Set horizontal and vertical gaps. Controls spacing between grid cells. objects.tuix_grid_set_bg(obj_ptr, r, g, b) -> int Set grid background color. Lets grid containers render as panels. objects.tuix_grid_clear_bg(obj_ptr) -> int Clear custom grid background. Returns grid to transparent/default background.
objects.tuix_grid_set_columns(grid, [(builders.GRID_TRACK_WEIGHT, 1), (builders.GRID_TRACK_FIXED, 24)])
objects.tuix_grid_set_rows(grid, [(builders.GRID_TRACK_FIXED, 3), (builders.GRID_TRACK_WEIGHT, 1)])
objects.tuix_grid_set_gaps(grid, 1, 1)