fn show_popup(s: &mut Cursive, name: &str) {
    if name.is_empty() {
        s.add_layer(Dialog::info("Please enter a name!"));
    } else {
        let content = format!("Hello {}!", name);
        s.pop_layer();
        s.add_layer(
            Dialog::around(TextView::new(content))
                .button("Quit", |s| s.quit()),
        );
    }
}
// This will replace the current layer with a new popup.
// If the name is empty, we'll show an error message instead.
This will replace the current layer with a new popup.
If the name is empty, we'll show an error message instead.
This will replace the current layer with a new popup . If the name is empty we ' ll show an error message instead .
fn show_popup(s: &mut Cursive, name: &str) {
    if name.is_empty() {
        s.add_layer(Dialog::info("Please enter a name!"));
    } else {
        let content = format!("Hello {}!", name);
        s.pop_layer();
        s.add_layer(
            Dialog::around(TextView::new(content))
                .button("Quit", |s| s.quit()),
        );
    }
}
fn show_popup ( s : & mut Cursive , name : & str ) { if name . is_empty ( ) { s . add_layer ( Dialog :: info ( " " ) ) ; } else { let content = format ! ( " " name ) ; s . pop_layer ( ) ; s . add_layer ( Dialog :: around ( TextView :: new ( content ) ) . button ( " " , | s | s . quit ( ) ) , ) ; } }
This will replace the current layer with a new popup.
This will replace the current layer with a new popup .
s
&mut Cursive
name
&str
s
&mut Cursive
name
&str