makepad-2.0-events

Installation
SKILL.md

Makepad 2.0 Event & Action System

Overview

Makepad 2.0 uses a two-layer event system:

  1. 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.

  2. Rust Layer -- The MatchEvent trait with handle_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
Installs
18
GitHub Stars
737
First Seen
Apr 5, 2026