fn ui_input_dialog(
    title: &str,
    id: &'static str,
    default: &str,
    submit: fn(&mut Cursive, &str),
) -> Dialog {
    Dialog::new()
        .title(title)
        .content(
            EditView::new()
                .on_submit(submit)
                .content(default)
                .with_id(id)
                .fixed_width(20),
        )
        .button("Ok", move |siv| {
            let text = siv
                .call_on_id(id, |v: &mut EditView| v.get_content())
                .unwrap();
            submit(siv, &text);
        })
}
/// Helper to create a dialog asking the user for a text string
Helper to create a dialog asking the user for a text string
Helper to create a dialog asking the user for a text string
fn ui_input_dialog(
    title: &str,
    id: &'static str,
    default: &str,
    submit: fn(&mut Cursive, &str),
) -> Dialog {
    Dialog::new()
        .title(title)
        .content(
            EditView::new()
                .on_submit(submit)
                .content(default)
                .with_id(id)
                .fixed_width(20),
        )
        .button("Ok", move |siv| {
            let text = siv
                .call_on_id(id, |v: &mut EditView| v.get_content())
                .unwrap();
            submit(siv, &text);
        })
}
fn ui_input_dialog ( title : & str , id : & ' static str , default : & str , submit : fn ( & mut Cursive , & str ) , ) -> Dialog { Dialog :: new ( ) . title ( title ) . content ( EditView :: new ( ) . on_submit ( submit ) . content ( default ) . with_id ( id ) . fixed_width ( 20 ) , ) . button ( " " , move | siv | { let text = siv . call_on_id ( id , | v : & mut EditView | v . get_content ( ) ) . unwrap ( ) ; submit ( siv , & text ) ; } ) }
Helper to create a dialog asking the user for a text string
Helper to create a dialog asking the user for a text string
title
&str
id
&'static str
default
&str
submit
fn(&mut Cursive, &str)