Trait NativeDialogExtManual

Source
pub trait NativeDialogExtManual: IsA<NativeDialog> {
    // Provided method
    fn run_future<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = ResponseType> + 'a>> { ... }
}

Provided Methods§

Source

fn run_future<'a>(&'a self) -> Pin<Box<dyn Future<Output = ResponseType> + 'a>>

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

use gtk::prelude::*;

let dialog = gtk::FileChooserNative::builder()
   .title("Select a File")
   .build();

dialog.run_future().await;
println!("Selected file: {:?}", dialog.file());
dialog.destroy();

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§