pub enum Event {
Show 26 variants
Pressed,
TextChanged(String),
Submitted,
ToggleChanged(bool),
ValueChanged(f64),
SelectionChanged(i64),
SelectionSet(Vec<i64>),
FocusChanged(bool),
Tap(Point),
LongPress(Point),
ContextMenu(Point),
Drag {
phase: DragPhase,
location: Point,
translation: Point,
},
ScrollChanged(Point),
FrameChanged(Size),
NavBack {
already_popped: bool,
},
Key(KeyEvent),
Pointer(PointerEvent),
WindowResized(Size),
RouteRequested(String),
PresentResult {
req: u64,
result: PresentResult,
},
Custom {
tag: &'static str,
num: f64,
text: String,
},
MenuAction(u64),
ToolbarChanged {
action: u64,
value: ToolbarValue,
},
Lifecycle(Lifecycle),
WindowClosed,
WindowFocused(bool),
}Variants§
Pressed
TextChanged(String)
Submitted
ToggleChanged(bool)
ValueChanged(f64)
SelectionChanged(i64)
SelectionSet(Vec<i64>)
A multi-select list’s selection changed: the FULL set of selected row indices,
ascending (empty = nothing selected). Emitted instead of SelectionChanged where
ListProps::multi_select is honored (docs/list.md).
FocusChanged(bool)
Tap(Point)
LongPress(Point)
ContextMenu(Point)
Drag
A drag/pan gesture (docs/shapes.md). location is in the node’s local coordinates;
translation is the cumulative movement since Began.
ScrollChanged(Point)
FrameChanged(Size)
A canvas node was re-framed by layout; re-record (§11). Nav pane/page containers also report their allocated size with this (docs/navigation.md).
Native back navigation (iOS back button/swipe, Android system back or toolbar up).
already_popped = the toolkit already performed the pop natively (iOS); the nav
host then syncs its stack WITHOUT re-issuing NavPatch::Popped.
Key(KeyEvent)
Pointer(PointerEvent)
WindowResized(Size)
RouteRequested(String)
The platform asks the app to show a route (docs/navigation.md): a runtime deep link —
on web-dom, the URL hash changing under the app (hand-edited, or browser back/forward).
Emitted on WINDOW_NODE; day-core answers with navigate() when the route differs
from the current one. Launch-time deep links use DAY_DEEPLINK/set_launch_deeplink
instead — this variant is for changes while the app runs.
PresentResult
A native modal answered request req (docs/dialogs.md).
Custom
An open, piece-defined event (§8.2). tag names the event for in-process emitters (a static
literal); it is empty for events that cross a native boundary (JNI/C-ABI), which carry only the
primitive num/text payload. A piece’s cx.on reads whichever fields it needs. This is the
escape hatch for events the fixed variants above don’t cover (a web view’s URL, a picked date, …).
MenuAction(u64)
A menu item (app menu or context menu) with this action id was activated (§ menus). day-core
routes it to the app closure registered for the id. Standard-role items don’t carry an id
(role items are handled natively) so they never emit this.
ToolbarChanged
A toolbar item produced a value — a search field’s text, a toggle’s new state
(docs/toolbars.md). action is the item’s dispatch id, from the same registry
Event::MenuAction uses, and day-core routes it to the closure registered for it.
A plain toolbar button has no value and emits MenuAction instead.
Lifecycle(Lifecycle)
The app moved through a lifecycle phase (docs/lifecycle.md). Backends emit this from the
native app/activity delegate; day-core routes it to the app’s on_lifecycle handlers.
WindowClosed
A secondary native window closed — the title-bar close, a platform gesture (an
app-switcher swipe, an activity finish), or Toolkit::close_window — emitted on the
WINDOW’S ROOT node after the platform committed the close. day-core disposes the
window’s subtree on receipt, so native and programmatic closes share one teardown
path (docs/windows.md). Never emitted for the primary window (its close terminates
the app).
WindowFocused(bool)
A secondary window’s key/active state changed — emitted on the window’s root node. day-core tracks the focused window with it (dialog parenting, dayscript targeting).