makepad-2.0-events
Installation
SKILL.md
Makepad 2.0 Event & Action System
Overview
Makepad 2.0 uses a two-layer event system:
-
Splash Layer -- Inline event handlers written directly in
script_mod!Splash code (on_click,on_render,on_return,on_startup). These handle UI interactions declaratively inside the script, close to the widget definitions. -
Rust Layer -- The
MatchEventtrait withhandle_actions,handle_timer,handle_http_response, etc. These handle business logic, external I/O, and anything that needs full Rust power.
Both layers communicate through two bridge macros:
script_eval!(cx, { ... })-- Execute Splash code from Rust (update state, trigger renders)script_apply_eval!(cx, widget_ref, { ... })-- Patch widget properties from Rust at runtime
Related skills