Trait gtk::prelude::DialogExtManual[][src]

pub trait DialogExtManual: 'static {
    fn add_buttons(&self, buttons: &[(&str, ResponseType)]);
fn run_future<'a>(
        &'a self
    ) -> Pin<Box<dyn Future<Output = ResponseType> + 'a>>; }

Required methods

Shows the dialog and returns a Future that resolves to the ResponseType on response.

use gtk::prelude::*;

let dialog = gtk::MessageDialogBuilder::new()
   .buttons(gtk::ButtonsType::OkCancel)
   .text("What is your answer?")
   .build();

let answer = dialog.run_future().await;
dialog.close();
println!("Answer: {:?}", answer);

Implementors