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.

The @callback will be called when the alert is dismissed. It should call AlertDialog::choose_finish() to obtain the result.

§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>>

Object Safety§

This trait is not object safe.

Implementors§