fn ui_builder() -> impl Widget<u32> {  //  `u32` is the application state
    console::print("Rust UI builder\n"); console::flush();
    //  Create a line of text based on a counter value
    let text =
        LocalizedString::new("hello-counter")
        .with_arg(
            "count", 
            //  Closure that will fetch the counter value...
            | data: &u32, _env |  //  Closure will receive the application state and environment
                (*data).into()    //  We return the counter value in the application state
        );
    //  Create a label widget to display the text
    let label = Label::new(text);
    //  Create a button widget to increment the counter
    let button = Button::new(
        "increment",  //  Text to be shown
        //  Closure that will be called when button is tapped...
        | _ctx, data, _env |  //  Closure will receive the context, application state and environment
            *data += 1        //  We increment the counter
    );

    //  Create a column for the UI
    let mut col = Column::new();
    //  Add the label widget to the column, centered with padding
    col.add_child(
        Align::centered(
            Padding::new(5.0, label)
        ),
        1.0
    );
    //  Add the button widget to the column, with padding
    col.add_child(
        Padding::new(5.0, button), 
        1.0
    );
    //  Return the column containing the label and button widgets
    col
}
/// Build the UI for the window. The application state consists of 1 value: `count` of type `u32`.
Build the UI for the window. The application state consists of 1 value: `count` of type `u32`.
Build the UI for the window . The application state consists of 1 value : ` count ` of type ` u32 ` .
fn ui_builder() -> impl Widget<u32> {  //  `u32` is the application state
    console::print("Rust UI builder\n"); console::flush();
    //  Create a line of text based on a counter value
    let text =
        LocalizedString::new("hello-counter")
        .with_arg(
            "count", 
            //  Closure that will fetch the counter value...
            | data: &u32, _env |  //  Closure will receive the application state and environment
                (*data).into()    //  We return the counter value in the application state
        );
    //  Create a label widget to display the text
    let label = Label::new(text);
    //  Create a button widget to increment the counter
    let button = Button::new(
        "increment",  //  Text to be shown
        //  Closure that will be called when button is tapped...
        | _ctx, data, _env |  //  Closure will receive the context, application state and environment
            *data += 1        //  We increment the counter
    );
    //  Create a column for the UI
    let mut col = Column::new();
    //  Add the label widget to the column, centered with padding
    col.add_child(
        Align::centered(
            Padding::new(5.0, label)
        ),
        1.0
    );
    //  Add the button widget to the column, with padding
    col.add_child(
        Padding::new(5.0, button), 
        1.0
    );
    //  Return the column containing the label and button widgets
    col
}
fn ui_builder ( ) -> impl Widget < u32 > { //  `u32` is the application state console :: print ( " \n " ) ; console :: flush ( ) ; //  Create a line of text based on a counter value let text = LocalizedString :: new ( " " ) . with_arg ( " " , //  Closure that will fetch the counter value... | data : & u32 , _env | //  Closure will receive the application state and environment ( * data ) . into ( ) //  We return the counter value in the application state ) ; //  Create a label widget to display the text let label = Label :: new ( text ) ; //  Create a button widget to increment the counter let button = Button :: new ( " " , //  Text to be shown //  Closure that will be called when button is tapped... | _ctx , data , _env | //  Closure will receive the context, application state and environment * data += 1 //  We increment the counter ) ; //  Create a column for the UI let mut col = Column :: new ( ) ; //  Add the label widget to the column, centered with padding col . add_child ( Align :: centered ( Padding :: new ( 5.0 , label ) ) , 1.0 ) ; //  Add the button widget to the column, with padding col . add_child ( Padding :: new ( 5.0 , button ) , 1.0 ) ; //  Return the column containing the label and button widgets col }
Build the UI for the window.
Build the UI for the window .