Register one menu item

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_menu_register_item

Purpose

Add an executable item to the reusable menu model.

Arguments

  • $1 — KEY - Unique menu key.
  • $2 — GROUP - Owning group key.
  • $3 — LABEL - Visible item label.
  • $4 — HANDLER - Function invoked when selected.
  • $5 — DESC - Optional description.
  • $6 — BUILTIN - 1 for host-owned controls, otherwise 0.
  • $7 — WAITSECS - Post-action countdown; normal actions are clamped to a minimum of 15 seconds when a non-zero wait is requested.
  • $8 — VISIBLE - Visibility state.
  • $9 — INDENT - Item indentation level.
  • $10 — STATUS - Optional transient status decoration.

Returns

0 when registered; non-zero on validation, duplicate-key, or handler errors.

Usage

  sgnd_menu_register_item "status" "system" "Show status" "show_status" "Display current status" 0 15 1 0