← All built-ins / ui_on()
ui_on()
ui_on(...$args): int
Parameters
| Name | Type | Description |
|---|---|---|
| $handle | int | control/menu-item/window handle |
| $event | string | "click", "change", "select", "close", … |
| $callback | closure | called when the event fires |
Return value
Registers an event handler.
Example
echo "ui_on($btn, "click", fn() => ui_set($lbl, "clicked!"));";
ui_on($btn, "click", fn() => ui_set($lbl, "clicked!"));
This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.