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