11// Copyright 2026 the Xilem Authors
22// SPDX-License-Identifier: Apache-2.0
33
4- use masonry:: app:: RenderRoot ;
4+ use masonry:: app:: { AppCtx , RenderRoot } ;
55use masonry:: core:: { Handled , NewWidget , Widget , WidgetId , WidgetTag } ;
66use masonry:: widgets:: { Flex , Label , PageChanged , Pagination , Step , StepInput } ;
77
@@ -53,6 +53,7 @@ impl DemoPage for PaginationDemo {
5353
5454 fn on_action (
5555 & mut self ,
56+ app_ctx : & mut AppCtx ,
5657 render_root : & mut RenderRoot ,
5758 action : & masonry:: core:: ErasedAction ,
5859 widget_id : WidgetId ,
@@ -86,34 +87,34 @@ impl DemoPage for PaginationDemo {
8687 . id ( ) ;
8788
8889 if widget_id == id_page_count {
89- render_root. edit_widget_with_tag ( self . tag_pagination , |mut widget| {
90+ render_root. edit_widget_with_tag ( app_ctx , self . tag_pagination , |mut widget| {
9091 Pagination :: set_page_count ( & mut widget, value as usize ) ;
9192 } ) ;
9293 return Handled :: Yes ;
9394 }
9495 if widget_id == id_page_active {
95- render_root. edit_widget_with_tag ( self . tag_content , |mut content| {
96+ render_root. edit_widget_with_tag ( app_ctx , self . tag_content , |mut content| {
9697 Label :: set_text ( & mut content, format ! ( "Now on page {}" , value) ) ;
9798 } ) ;
98- render_root. edit_widget_with_tag ( self . tag_pagination , |mut widget| {
99+ render_root. edit_widget_with_tag ( app_ctx , self . tag_pagination , |mut widget| {
99100 Pagination :: set_active_page ( & mut widget, ( value - 1 ) as usize ) ;
100101 } ) ;
101102 return Handled :: Yes ;
102103 }
103104 if widget_id == id_buttons_start {
104- render_root. edit_widget_with_tag ( self . tag_pagination , |mut widget| {
105+ render_root. edit_widget_with_tag ( app_ctx , self . tag_pagination , |mut widget| {
105106 Pagination :: set_buttons_start ( & mut widget, value as u8 ) ;
106107 } ) ;
107108 return Handled :: Yes ;
108109 }
109110 if widget_id == id_buttons_end {
110- render_root. edit_widget_with_tag ( self . tag_pagination , |mut widget| {
111+ render_root. edit_widget_with_tag ( app_ctx , self . tag_pagination , |mut widget| {
111112 Pagination :: set_buttons_end ( & mut widget, value as u8 ) ;
112113 } ) ;
113114 return Handled :: Yes ;
114115 }
115116 if widget_id == id_buttons_total {
116- render_root. edit_widget_with_tag ( self . tag_pagination , |mut widget| {
117+ render_root. edit_widget_with_tag ( app_ctx , self . tag_pagination , |mut widget| {
117118 Pagination :: set_buttons_total ( & mut widget, value as u8 ) ;
118119 } ) ;
119120 return Handled :: Yes ;
@@ -131,10 +132,10 @@ impl DemoPage for PaginationDemo {
131132 return Handled :: No ;
132133 }
133134
134- render_root. edit_widget_with_tag ( self . tag_content , |mut content| {
135+ render_root. edit_widget_with_tag ( app_ctx , self . tag_content , |mut content| {
135136 Label :: set_text ( & mut content, format ! ( "Now on page {}" , page_idx + 1 ) ) ;
136137 } ) ;
137- render_root. edit_widget_with_tag ( self . tag_page_active , |mut widget| {
138+ render_root. edit_widget_with_tag ( app_ctx , self . tag_page_active , |mut widget| {
138139 StepInput :: set_base ( & mut widget, ( page_idx + 1 ) . cast_signed ( ) ) ;
139140 } ) ;
140141 return Handled :: Yes ;
0 commit comments