API reference#

The whole API is two headers. ui.h has every function and is the only one a program includes; it includes ui_theme.h, which has the style types, palette roles and theme objects.

Frame loop and time

ui_init, ui_frame, ui_quit, ui_exit, ui_wake, ui_ms.

Frame loop and time
Keys and focus

Reading keys, ids, enabling and focus.

Keys and focus
Layout

Columns, heights, panels and scroll areas.

Layout
Widgets

Title bar, softkeys, text, buttons, values and text input.

Widgets
Lists, tables and tabs

Virtual lists, table headers and tabs.

Lists, tables and tabs
Overlays

Modals, messages, confirmations, menus and toasts.

Overlays
Drawing

Images and canvases.

Drawing
Styles and colors

Per-widget styles and the palette at run time.

Styles and colors
Theme header

Style types, roles, macros and theme objects.

Theme header

Every function#

Function

Returns

ui_init, ui_exit, ui_quit, ui_invalidate, ui_wake

Nothing

ui_frame

False once ui_quit was called

ui_ms

Milliseconds since ui_init

ui_key

This frame’s unused key, or 0

ui_key_pressed

True when the key matched; it is used up

ui_listen, ui_next_id, ui_enabled, ui_focus_here

Nothing

ui_focused

True when the last widget has focus

ui_next_style, ui_palette, ui_set_color

Nothing

ui_color

The palette index of a slot

ui_fmt

The formatted text

ui_columns, ui_height, ui_space, ui_separator

Nothing

ui_panel_begin, ui_panel_end, ui_scroll_begin, ui_scroll_end

Nothing

ui_titlebar

Nothing

ui_softkeys

UI_F1 to UI_F5, or -1

ui_heading, ui_text, ui_caption, ui_label

Nothing

ui_button, ui_icon_button

True in the frame it is activated

ui_check, ui_toggle, ui_choice, ui_select, ui_slider, ui_number

True in the frame the value changed

ui_radio

True in the frame it is activated

ui_progress, ui_spinner

Nothing

ui_input

True when [enter] is pressed

ui_textarea

True in the frame the text changed

ui_list_begin

Nothing

ui_list_next

True for each visible row

ui_list_end

The activated row, or -1

ui_header

Nothing

ui_tabs

True in the frame the tab changed

ui_modal_begin

True while the modal is open

ui_modal_end, ui_message, ui_toast

Nothing

ui_confirm

UI_YES, UI_NO or UI_PENDING

ui_menu

The picked item, or -1

ui_image, ui_canvas

Nothing