pub trait DialogExt: IsA<Dialog> + 'static {
// Provided methods
fn add_action_widget(
&self,
child: &impl IsA<Widget>,
response_id: ResponseType,
) { ... }
fn add_button(&self, button_text: &str, response_id: ResponseType) -> Widget { ... }
fn content_area(&self) -> Box { ... }
fn header_bar(&self) -> HeaderBar { ... }
fn widget_for_response(&self, response_id: ResponseType) -> Option<Widget> { ... }
fn response(&self, response_id: ResponseType) { ... }
fn set_default_response(&self, response_id: ResponseType) { ... }
fn set_response_sensitive(&self, response_id: ResponseType, setting: bool) { ... }
fn use_header_bar(&self) -> i32 { ... }
fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn emit_close(&self) { ... }
fn connect_response<F: Fn(&Self, ResponseType) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Trait containing all Dialog
methods.
§Implementors
AppChooserDialog
, ColorChooserDialog
, Dialog
, FileChooserDialog
, FontChooserDialog
, MessageDialog
, PageSetupUnixDialog
, PrintUnixDialog
Provided Methods§
Sourcefn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType)
👎Deprecated: Since 4.10
fn add_action_widget(&self, child: &impl IsA<Widget>, response_id: ResponseType)
Adds an activatable widget to the action area of a Dialog
.
GTK connects a signal handler that will emit the
response
signal on the dialog when the widget
is activated. The widget is appended to the end of the dialog’s action
area.
If you want to add a non-activatable widget, simply pack it into
the @action_area field of the Dialog
struct.
§Deprecated since 4.10
Use Window
instead
§child
an activatable widget
§response_id
response ID for @child
👎Deprecated: Since 4.10
Adds a button with the given text.
GTK arranges things so that clicking the button will emit the
response
signal with the given @response_id.
The button is appended to the end of the dialog’s action area.
The button widget is returned, but usually you don’t need it.
§Deprecated since 4.10
Use Window
instead
§button_text
text of button
§response_id
response ID for the button
§Returns
the Button
widget that was added
Sourcefn content_area(&self) -> Box
👎Deprecated: Since 4.10
fn content_area(&self) -> Box
Sourcefn header_bar(&self) -> HeaderBar
👎Deprecated: Since 4.10
fn header_bar(&self) -> HeaderBar
Returns the header bar of @self.
Note that the headerbar is only used by the dialog if the
use-header-bar
property is true
.
§Deprecated since 4.10
Use Window
instead
§Returns
the header bar
Sourcefn widget_for_response(&self, response_id: ResponseType) -> Option<Widget>
👎Deprecated: Since 4.10
fn widget_for_response(&self, response_id: ResponseType) -> Option<Widget>
Sourcefn response(&self, response_id: ResponseType)
👎Deprecated: Since 4.10
fn response(&self, response_id: ResponseType)
Sourcefn set_default_response(&self, response_id: ResponseType)
👎Deprecated: Since 4.10
fn set_default_response(&self, response_id: ResponseType)
Sourcefn set_response_sensitive(&self, response_id: ResponseType, setting: bool)
👎Deprecated: Since 4.10
fn set_response_sensitive(&self, response_id: ResponseType, setting: bool)
Sourcefn use_header_bar(&self) -> i32
👎Deprecated: Since 4.10
fn use_header_bar(&self) -> i32
true
if the dialog uses a headerbar for action buttons
instead of the action-area.
For technical reasons, this property is declared as an integer
property, but you should only set it to true
or false
.
§Creating a dialog with headerbar
Builtin Dialog
subclasses such as ColorChooserDialog
set this property according to platform conventions (using the
gtk-dialogs-use-header
setting).
Here is how you can achieve the same:
⚠️ The following code is in c ⚠️
g_object_get (settings, "gtk-dialogs-use-header", &header, NULL);
dialog = g_object_new (GTK_TYPE_DIALOG, header, TRUE, NULL);
§Deprecated since 4.10
Use Window
instead
Sourcefn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
👎Deprecated: Since 4.10
fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the user uses a keybinding to close the dialog.
This is a keybinding signal.
The default binding for this signal is the Escape key.
§Deprecated since 4.10
Use Window
instead
fn emit_close(&self)
Sourcefn connect_response<F: Fn(&Self, ResponseType) + 'static>(
&self,
f: F,
) -> SignalHandlerId
👎Deprecated: Since 4.10
fn connect_response<F: Fn(&Self, ResponseType) + 'static>( &self, f: F, ) -> SignalHandlerId
Emitted when an action widget is clicked.
The signal is also emitted when the dialog receives a
delete event, and when response()
is called.
On a delete event, the response ID is ResponseType::DeleteEvent
.
Otherwise, it depends on which action widget was clicked.
§Deprecated since 4.10
Use Window
instead
§response_id
the response ID
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.