Trait libadwaita::prelude::MessageDialogExt
source · pub trait MessageDialogExt: IsA<MessageDialog> + Sealed + 'static {
Show 31 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 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 response(&self, response: &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_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 { ... }
}
v1_2
only.Expand description
Provided Methods§
sourcefn add_response(&self, id: &str, label: &str)
👎Deprecated: Since 1.6
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.
§Deprecated since 1.6
Use AlertDialog
.
§id
the response ID
§label
the response label
sourcefn is_body_use_markup(&self) -> bool
👎Deprecated: Since 1.6
fn is_body_use_markup(&self) -> bool
Gets whether the body text of @self includes Pango markup.
§Deprecated since 1.6
Use AlertDialog
.
§Returns
whether @self uses markup for body text
sourcefn close_response(&self) -> GString
👎Deprecated: Since 1.6
fn close_response(&self) -> GString
Gets the ID of the close response of @self.
§Deprecated since 1.6
Use AlertDialog
.
§Returns
the close response ID
sourcefn default_response(&self) -> Option<GString>
👎Deprecated: Since 1.6
fn default_response(&self) -> Option<GString>
Gets the ID of the default response of @self.
§Deprecated since 1.6
Use AlertDialog
.
§Returns
the default response ID
sourcefn extra_child(&self) -> Option<Widget>
👎Deprecated: Since 1.6
fn extra_child(&self) -> Option<Widget>
Gets the child widget of @self.
§Deprecated since 1.6
Use AlertDialog
.
§Returns
the child widget of @self.
sourcefn is_heading_use_markup(&self) -> bool
👎Deprecated: Since 1.6
fn is_heading_use_markup(&self) -> bool
Gets whether the heading of @self includes Pango markup.
§Deprecated since 1.6
Use AlertDialog
.
§Returns
whether @self uses markup for heading
sourcefn response_appearance(&self, response: &str) -> ResponseAppearance
👎Deprecated: Since 1.6
fn response_appearance(&self, response: &str) -> ResponseAppearance
Gets the appearance of @response.
See set_response_appearance()
.
§Deprecated since 1.6
Use AlertDialog
.
§response
a response ID
§Returns
the appearance of @response
sourcefn is_response_enabled(&self, response: &str) -> bool
👎Deprecated: Since 1.6
fn is_response_enabled(&self, response: &str) -> bool
Gets whether @response is enabled.
§Deprecated since 1.6
Use AlertDialog
.
§response
a response ID
§Returns
whether @response is enabled
sourcefn has_response(&self, response: &str) -> bool
👎Deprecated: Since 1.6
fn has_response(&self, response: &str) -> bool
Gets whether @self has a response with the ID @response.
§Deprecated since 1.6
Use AlertDialog
.
§response
response ID
§Returns
whether @self has a response with the ID @response.
sourcefn remove_response(&self, id: &str)
👎Deprecated: Since 1.6Available on crate feature v1_5
only.
fn remove_response(&self, id: &str)
v1_5
only.sourcefn response(&self, response: &str)
👎Deprecated: Since 1.6
fn response(&self, response: &str)
Emits the response
signal with the given response ID.
Used to indicate that the user has responded to the dialog in some way.
§Deprecated since 1.6
Use AlertDialog
.
§response
response ID
sourcefn set_body_use_markup(&self, use_markup: bool)
👎Deprecated: Since 1.6
fn set_body_use_markup(&self, use_markup: bool)
Sets whether the body text of @self includes Pango markup.
See parse_markup()
.
§Deprecated since 1.6
Use AlertDialog
.
§use_markup
whether to use markup for body text
sourcefn set_close_response(&self, response: &str)
👎Deprecated: Since 1.6
fn set_close_response(&self, response: &str)
Sets the ID of the close response of @self.
It will be passed to response
if the window is
closed by pressing Escape or with a system action.
It doesn’t have to correspond to any of the responses in the dialog.
The default close response is close
.
§Deprecated since 1.6
Use AlertDialog
.
§response
the close response ID
sourcefn set_default_response(&self, response: Option<&str>)
👎Deprecated: Since 1.6
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.
§Deprecated since 1.6
Use AlertDialog
.
§response
the default response ID
sourcefn set_extra_child(&self, child: Option<&impl IsA<Widget>>)
👎Deprecated: Since 1.6
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.
§Deprecated since 1.6
Use AlertDialog
.
§child
the child widget
sourcefn set_heading(&self, heading: Option<&str>)
👎Deprecated: Since 1.6
fn set_heading(&self, heading: Option<&str>)
sourcefn set_heading_use_markup(&self, use_markup: bool)
👎Deprecated: Since 1.6
fn set_heading_use_markup(&self, use_markup: bool)
Sets whether the heading of @self includes Pango markup.
See parse_markup()
.
§Deprecated since 1.6
Use AlertDialog
.
§use_markup
whether to use markup for heading
sourcefn set_response_appearance(
&self,
response: &str,
appearance: ResponseAppearance,
)
👎Deprecated: Since 1.6
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.
§Deprecated since 1.6
Use AlertDialog
.
§response
a response ID
§appearance
appearance for @response
sourcefn set_response_enabled(&self, response: &str, enabled: bool)
👎Deprecated: Since 1.6
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.
§Deprecated since 1.6
Use AlertDialog
.
§response
a response ID
§enabled
whether to enable @response
sourcefn set_response_label(&self, response: &str, label: &str)
👎Deprecated: Since 1.6
fn set_response_label(&self, response: &str, label: &str)
Sets the label of @response to @label.
Labels are displayed on the dialog buttons. An embedded underline in @label indicates a mnemonic.
§Deprecated since 1.6
Use AlertDialog
.
§response
a response ID
§label
the label of @response
sourcefn connect_response<F: Fn(&Self, &str) + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId
👎Deprecated: Since 1.6
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
.
§Deprecated since 1.6
Use AlertDialog
.
§response
the response ID