You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: masonry/src/doc/implementing_widget.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ In the course of a frame, Masonry will run a series of passes over the widget tr
48
48
-`on_pointer_event`, `on_text_event` and `on_access_event` are called once after a user-initiated event (like a mouse click or keyboard input).
49
49
-`on_anim_frame` is called once per frame for animated widgets.
50
50
-`update` is called many times during a frame, with various events reflecting changes in the widget's state (for instance, it gets or loses text focus).
51
-
-`update` is also where timers requested by the widget are delivered as `Update::Timer`.
51
+
-`update` is also where timers requested by the widget are delivered as `Update::TimerExpired`.
52
52
-`measure` and `layout` are called during Masonry's layout pass.
53
53
`measure` computes the preferred size of the widget on a single axis.
54
54
`layout` receives a chosen size and lays out its children accordingly.
@@ -165,8 +165,8 @@ impl Widget for ColorRectangle {
165
165
166
166
Use `on_anim_frame` for visual state that should advance with frame cadence, such as continuous motion or interpolation.
167
167
For delayed one-shot behavior, use a timer instead.
168
-
For example, a widget can store an `Option<TimerToken>`, set it with `ctx.request_timer(delay)`, then compare it against `Update::Timer(token)` in `update`.
169
-
If the delayed behavior should continue, request a new one-shot timer from that `Update::Timer` branch.
168
+
For example, a widget can store an `Option<TimerToken>`, set it with `ctx.request_timer(delay)`, then compare it against `Update::TimerExpired(token)` in `update`.
169
+
If the delayed behavior should continue, request a new one-shot timer from that `Update::TimerExpired` branch.
170
170
Cancel the stored token with `ctx.cancel_timer(token)` when the state that made the timer relevant no longer applies.
0 commit comments