fn use_app(ctx: &mut WidgetContext) {
    ctx.life_cycle.change(|ctx| {
        for msg in ctx.messenger.messages {
            if let Some(msg) = msg.as_any().downcast_ref::<ButtonNotifyMessage>() {
                println!("Button message: {:#?}", msg);
            }
        }
    });
}
// we create app hook that just receives button state change messages and prints them.
we create app hook that just receives button state change messages and prints them.
we create app hook that just receives button state change messages and prints them .
fn use_app(ctx: &mut WidgetContext) {
    ctx.life_cycle.change(|ctx| {
        for msg in ctx.messenger.messages {
            if let Some(msg) = msg.as_any().downcast_ref::<ButtonNotifyMessage>() {
                println!("Button message: {:#?}", msg);
            }
        }
    });
}
fn use_app ( ctx : & mut WidgetContext ) { ctx . life_cycle . change ( | ctx | { for msg in ctx . messenger . messages { if let Some ( msg ) = msg . as_any ( ) . downcast_ref :: < ButtonNotifyMessage > ( ) { println ! ( " " msg ) ; } } } ) ; }
we create app hook that just receives button state change messages and prints them.
we create app hook that just receives button state change messages and prints them .
ctx
&mut WidgetContext
ctx
&mut WidgetContext