Function confirm_dialog

Source
pub fn confirm_dialog<T, U, C>(title: T, text: U, cb: C) -> OnEventView<Dialog>
where T: Display, U: Into<StyledString>, C: Fn(&mut Cursive) + Send + Sync + 'static,
Expand description

Convenience function that creates a dialog that runs a callback if the user selects “Yes”

§Example

let mut root = cursive::default();
root.add_layer(confirm_dialog("Are you sure?", "I solemnly swear that I am up to no good. /s", |view| view.quit()));
root.run();
OSZAR »