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
@@ -113,9 +115,11 @@ Because our widget tree only has one button and one textbox, there is no possibl
113
115
114
116
When handling `ButtonPressed`:
115
117
116
-
-`ctx.get_root()` returns a `WidgetMut<RootWidget<...>>`.
117
-
-`root.child_mut()` returns a `WidgetMut<Portal<...>>` for the `Portal`.
118
-
-`portal.child_mut()` returns a `WidgetMut<Flex>` for the `Flex`.
118
+
-`ctx.render_root()` returns a reference to the `RenderRoot`, which owns the widget tree and all the associated visual state.
119
+
-`RenderRoot::edit_root_widget()` takes a closure; that closure takes a `WidgetMut<Box<dyn Widget>>` which we call `root`. Once the closure returns, `RenderRoot` runs some passes to update the app's internal states.
120
+
-`root.downcast::<...>()` returns a `WidgetMut<RootWidget<...>>`.
121
+
-`RootWidget::child_mut()` returns a `WidgetMut<Portal<...>>` for the `Portal`.
122
+
-`Portal::child_mut()` returns a `WidgetMut<Flex>` for the `Flex`.
119
123
120
124
A [`WidgetMut`] is a smart reference type which lets us modify the widget tree.
121
125
It's set up to automatically propagate update flags and update internal state when dropped.
@@ -165,7 +169,7 @@ The last step is to create our Winit window and start our main loop.
0 commit comments