Gtk.NativeDialog¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w |
|||
r/w/c/en |
|||
r/w/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the user responds to the dialog. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gtk.NativeDialog(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Native dialogs are platform dialogs that don’t use
GtkDialog
.They are used in order to integrate better with a platform, by looking the same as other native applications and supporting platform specific features.
The [class`Gtk`.Dialog] functions cannot be used on such objects, but we need a similar API in order to drive them. The
GtkNativeDialog
object is an API that allows you to do this. It allows you to set various common properties on the dialog, as well as show and hide it and get a [signal`Gtk`.NativeDialog::response] signal when the user finished with the dialog.Note that unlike
GtkDialog
,GtkNativeDialog
objects are not toplevel widgets, and GTK does not keep them alive. It is your responsibility to keep a reference until you are done with the object.- destroy()[source]¶
Destroys a dialog.
When a dialog is destroyed, it will break any references it holds to other objects.
If it is visible it will be hidden and any underlying window system resources will be destroyed.
Note that this does not release any reference to the object (as opposed to destroying a
GtkWindow
) because there is no reference from the windowing system to theGtkNativeDialog
.
- get_title()[source]¶
- Returns:
the title of the dialog, or
None
if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.- Return type:
Gets the title of the
GtkNativeDialog
.
- get_transient_for()[source]¶
- Returns:
the transient parent for this window, or
None
if no transient parent has been set.- Return type:
Gtk.Window
orNone
Fetches the transient parent for this window.
- hide()[source]¶
Hides the dialog if it is visible, aborting any interaction.
Once this is called the [signal`Gtk`.NativeDialog::response] signal will *not* be emitted until after the next call to [method`Gtk`.NativeDialog.show].
If the dialog is not visible this does nothing.
- set_modal(modal)[source]¶
- Parameters:
modal (
bool
) – whether the window is modal
Sets a dialog modal or non-modal.
Modal dialogs prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use [method`Gtk`.NativeDialog.set_transient_for] to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.
- set_title(title)[source]¶
- Parameters:
title (
str
) – title of the dialog
Sets the title of the
GtkNativeDialog.
- set_transient_for(parent)[source]¶
- Parameters:
parent (
Gtk.Window
orNone
) – parent window
Dialog windows should be set transient for the main application window they were spawned from.
This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window.
Passing
None
for parent unsets the current transient window.
- show()[source]¶
Shows the dialog on the display.
When the user accepts the state of the dialog the dialog will be automatically hidden and the [signal`Gtk`.NativeDialog::response] signal will be emitted.
Multiple calls while the dialog is visible will be ignored.
- do_hide() virtual¶
Hides the dialog if it is visible, aborting any interaction.
Once this is called the [signal`Gtk`.NativeDialog::response] signal will *not* be emitted until after the next call to [method`Gtk`.NativeDialog.show].
If the dialog is not visible this does nothing.
- do_response(response_id) virtual¶
- Parameters:
response_id (
int
) –
class handler for the
GtkNativeDialog::response
signal
- do_show() virtual¶
Shows the dialog on the display.
When the user accepts the state of the dialog the dialog will be automatically hidden and the [signal`Gtk`.NativeDialog::response] signal will be emitted.
Multiple calls while the dialog is visible will be ignored.
Signal Details¶
- Gtk.NativeDialog.signals.response(native_dialog, response_id)¶
- Signal Name:
response
- Flags:
- Parameters:
native_dialog (
Gtk.NativeDialog
) – The object which received the signalresponse_id (
int
) – the response ID
Emitted when the user responds to the dialog.
When this is called the dialog has been hidden.
If you call [method`Gtk`.NativeDialog.hide] before the user responds to the dialog this signal will not be emitted.
Property Details¶
- Gtk.NativeDialog.props.modal¶
- Name:
modal
- Type:
- Default Value:
- Flags:
Whether the window should be modal with respect to its transient parent.
- Gtk.NativeDialog.props.title¶
-
The title of the dialog window