Trait libadwaita::prelude::AlertDialogExt
source · pub trait AlertDialogExt: IsA<AlertDialog> + Sealed + 'static {
Show 33 methods
// Provided methods
fn add_response(&self, id: &str, label: &str) { ... }
fn body(&self) -> GString { ... }
fn is_body_use_markup(&self) -> bool { ... }
fn close_response(&self) -> GString { ... }
fn default_response(&self) -> Option<GString> { ... }
fn extra_child(&self) -> Option<Widget> { ... }
fn heading(&self) -> Option<GString> { ... }
fn is_heading_use_markup(&self) -> bool { ... }
fn prefers_wide_layout(&self) -> bool { ... }
fn response_appearance(&self, response: &str) -> ResponseAppearance { ... }
fn is_response_enabled(&self, response: &str) -> bool { ... }
fn has_response(&self, response: &str) -> bool { ... }
fn remove_response(&self, id: &str) { ... }
fn set_body(&self, body: &str) { ... }
fn set_body_use_markup(&self, use_markup: bool) { ... }
fn set_close_response(&self, response: &str) { ... }
fn set_default_response(&self, response: Option<&str>) { ... }
fn set_extra_child(&self, child: Option<&impl IsA<Widget>>) { ... }
fn set_heading(&self, heading: Option<&str>) { ... }
fn set_heading_use_markup(&self, use_markup: bool) { ... }
fn set_prefer_wide_layout(&self, prefer_wide_layout: bool) { ... }
fn set_response_appearance(
&self,
response: &str,
appearance: ResponseAppearance,
) { ... }
fn set_response_enabled(&self, response: &str, enabled: bool) { ... }
fn set_response_label(&self, response: &str, label: &str) { ... }
fn connect_response<F: Fn(&Self, &str) + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId { ... }
fn connect_body_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_body_use_markup_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_close_response_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_default_response_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_extra_child_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_heading_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_heading_use_markup_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_prefer_wide_layout_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
v1_5
only.Expand description
Provided Methods§
sourcefn add_response(&self, id: &str, label: &str)
fn add_response(&self, id: &str, label: &str)
Adds a response with @id and @label to @self.
Responses are represented as buttons in the dialog.
Response ID must be unique. It will be used in response
to tell which response had been activated, as well as to inspect and modify
the response later.
An embedded underline in @label indicates a mnemonic.
set_response_label()
can be used to change the response
label after it had been added.
set_response_enabled()
and
set_response_appearance()
can be used to customize the
responses further.
§id
the response ID
§label
the response label
sourcefn is_body_use_markup(&self) -> bool
fn is_body_use_markup(&self) -> bool
Gets whether the body text of @self includes Pango markup.
§Returns
whether @self uses markup for body text
sourcefn close_response(&self) -> GString
fn close_response(&self) -> GString
sourcefn default_response(&self) -> Option<GString>
fn default_response(&self) -> Option<GString>
sourcefn extra_child(&self) -> Option<Widget>
fn extra_child(&self) -> Option<Widget>
sourcefn is_heading_use_markup(&self) -> bool
fn is_heading_use_markup(&self) -> bool
Gets whether the heading of @self includes Pango markup.
§Returns
whether @self uses markup for heading
sourcefn prefers_wide_layout(&self) -> bool
fn prefers_wide_layout(&self) -> bool
sourcefn response_appearance(&self, response: &str) -> ResponseAppearance
fn response_appearance(&self, response: &str) -> ResponseAppearance
Gets the appearance of @response.
See set_response_appearance()
.
§response
a response ID
§Returns
the appearance of @response
sourcefn is_response_enabled(&self, response: &str) -> bool
fn is_response_enabled(&self, response: &str) -> bool
sourcefn has_response(&self, response: &str) -> bool
fn has_response(&self, response: &str) -> bool
sourcefn remove_response(&self, id: &str)
fn remove_response(&self, id: &str)
sourcefn set_body_use_markup(&self, use_markup: bool)
fn set_body_use_markup(&self, use_markup: bool)
Sets whether the body text of @self includes Pango markup.
See parse_markup()
.
§use_markup
whether to use markup for body text
sourcefn set_close_response(&self, response: &str)
fn set_close_response(&self, response: &str)
sourcefn set_default_response(&self, response: Option<&str>)
fn set_default_response(&self, response: Option<&str>)
Sets the ID of the default response of @self.
If set, pressing Enter will activate the corresponding button.
If set to NULL
or to a non-existent response ID, pressing Enter
will do nothing.
§response
the default response ID
sourcefn set_extra_child(&self, child: Option<&impl IsA<Widget>>)
fn set_extra_child(&self, child: Option<&impl IsA<Widget>>)
Sets the child widget of @self.
The child widget is displayed below the heading and body.
§child
the child widget
sourcefn set_heading(&self, heading: Option<&str>)
fn set_heading(&self, heading: Option<&str>)
sourcefn set_heading_use_markup(&self, use_markup: bool)
fn set_heading_use_markup(&self, use_markup: bool)
Sets whether the heading of @self includes Pango markup.
See parse_markup()
.
§use_markup
whether to use markup for heading
sourcefn set_prefer_wide_layout(&self, prefer_wide_layout: bool)
Available on crate feature v1_6
only.
fn set_prefer_wide_layout(&self, prefer_wide_layout: bool)
v1_6
only.Sets whether @self prefers wide layout.
Prefer horizontal button layout when possible, and wider dialog width otherwise.
§prefer_wide_layout
whether to prefer wide layout
sourcefn set_response_appearance(
&self,
response: &str,
appearance: ResponseAppearance,
)
fn set_response_appearance( &self, response: &str, appearance: ResponseAppearance, )
Sets the appearance for @response.
Use ADW_RESPONSE_SUGGESTED
to mark important responses such as the
affirmative action, like the Save button in the example.
Use ADW_RESPONSE_DESTRUCTIVE
to draw attention to the potentially damaging
consequences of using @response. This appearance acts as a warning to the
user. The Discard button in the example is using this appearance.
The default appearance is ADW_RESPONSE_DEFAULT
.
Negative responses like Cancel or Close should use the default appearance.
§response
a response ID
§appearance
appearance for @response
sourcefn set_response_enabled(&self, response: &str, enabled: bool)
fn set_response_enabled(&self, response: &str, enabled: bool)
Sets whether @response is enabled.
If @response is not enabled, the corresponding button will have
sensitive
set to FALSE
and it can’t be activated as
a default response.
@response can still be used as close-response
while
it’s not enabled.
Responses are enabled by default.
§response
a response ID
§enabled
whether to enable @response
sourcefn set_response_label(&self, response: &str, label: &str)
fn set_response_label(&self, response: &str, label: &str)
sourcefn connect_response<F: Fn(&Self, &str) + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId
fn connect_response<F: Fn(&Self, &str) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId
This signal is emitted when the dialog is closed.
@response will be set to the response ID of the button that had been activated.
if the dialog was closed by pressing Escape or with a system
action, @response will be set to the value of
close-response
.
§response
the response ID
fn connect_body_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_body_use_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_close_response_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_default_response_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_extra_child_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_heading_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_heading_use_markup_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_prefer_wide_layout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_6
only.