Bedtime. /Menu System

Menu System

Pre-built menu UI components

ui_menu_t* ui_menu_create(void* app_ctx, ui_menu_sub_cb root_builder)

Create a menu instance

void*app_ctxApp context (typically os_app_t*)
ui_menu_sub_cbroot_builderRoot menu builder callback

Returns — Pointer to menu instance, or NULL on error

void ui_menu_destroy(ui_menu_t* menu)

Destroy a menu instance

ui_menu_t*menuMenu instance
void ui_menu_add(ui_menu_t* menu, ui_menu_node_t entry)

Add an entry to the menu

ui_menu_t*menuMenu instance
ui_menu_node_tentryMenu node entry
void* ui_menu_ctx(ui_menu_t* menu)

Get menu context

ui_menu_t*menuMenu instance

Returns — Context pointer passed to ui_menu_create

void ui_menu_rebuild(ui_menu_t* menu)

Rebuild current menu view

ui_menu_t*menuMenu instance
void ui_menu_input(ui_menu_t* menu, uint8_t button_id, KeyStateEnum state)

Unified input handler for menus

ui_menu_t*menuMenu instance
uint8_tbutton_idButton ID (0-5)
KeyStateEnumstateButton state
void ui_menu_show(ui_menu_t* menu)

Show menu (attach to widget layer)

ui_menu_t*menuMenu instance
void ui_menu_hide(ui_menu_t* menu)

Hide menu (detach from widget layer)

ui_menu_t*menuMenu instance
bool ui_menu_is_visible(ui_menu_t* menu)

Check if menu is visible

ui_menu_t*menuMenu instance

Returns — true if visible

void ui_hints_set_labels(const tapp_hint_pair_t* labels)

One button's hint labels. NULL or "" leaves that action blank.

const tapp_hint_pair_t*labelsarray of 5, in physical button order BTN1..BTN5
void ui_hints_show(bool stat)

Show or hide UI hints

boolstattrue to show hints, false to hide
void ui_statusbar_show(bool state)

Show or hide the whole system statusbar (battery, status items, hints)

boolstatetrue to show, false to hide

Note — Device-only: the desktop emulator does not render the statusbar.