libadwaita::prelude

Trait AlertDialogExtManual

source
pub trait AlertDialogExtManual:
    Sealed
    + IsA<AlertDialog>
    + 'static {
    // Provided methods
    fn response_label(&self, response: &str) -> GString { ... }
    fn add_responses(&self, ids_and_labels: &[(&str, &str)]) { ... }
    fn choose<P: FnOnce(GString) + 'static>(
        self,
        parent: &impl IsA<Widget>,
        cancellable: Option<&impl IsA<Cancellable>>,
        callback: P,
    ) { ... }
    fn choose_future(
        self,
        parent: &impl IsA<Widget>,
    ) -> Pin<Box_<dyn Future<Output = GString> + 'static>> { ... }
}
Available on crate feature v1_5 only.

Provided Methods§

source

fn response_label(&self, response: &str) -> GString

Gets the label of @response.

See AlertDialogExt::set_response_label().

§response

a response ID

§Returns

the label of @response

source

fn add_responses(&self, ids_and_labels: &[(&str, &str)])

Adds multiple responses to @self.

This is the same as calling AlertDialogExt::add_response() repeatedly. The variable argument list should be NULL-terminated list of response IDs and labels.

Example:

⚠️ The following code is in c ⚠️

adw_alert_dialog_add_responses (dialog,
                                "cancel",  _("_Cancel"),
                                "discard", _("_Discard"),
                                "save",    _("_Save"),
                                NULL);
§first_id

response id

source

fn choose<P: FnOnce(GString) + 'static>( self, parent: &impl IsA<Widget>, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )

This function shows @self to the user.

If the window is an Window or ApplicationWindow, the dialog will be shown within it. Otherwise, it will be a separate window.

§parent

the parent widget

§cancellable

a GCancellable to cancel the operation

§callback

a callback to call when the operation is complete

source

fn choose_future( self, parent: &impl IsA<Widget>, ) -> Pin<Box_<dyn Future<Output = GString> + 'static>>

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§