:right-sidebar: True NativeDialog =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: NativeDialog(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gtk.FileChooserNative` :Constructors: :: NativeDialog(**properties) Methods ------- .. rst-class:: interim-class .. class:: NativeDialog :no-index: .. method:: destroy() -> None 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 the ``GtkNativeDialog``. .. method:: get_modal() -> bool Returns whether the dialog is modal. .. method:: get_title() -> str | None Gets the title of the ``GtkNativeDialog``. .. method:: get_transient_for() -> ~gi.repository.Gtk.Window | None Fetches the transient parent for this window. .. method:: get_visible() -> bool Determines whether the dialog is visible. .. method:: hide() -> None Hides the dialog if it is visible, aborting any interaction. Once this is called the :obj:`~gi.repository.Gtk.NativeDialog.signals.response` signal will *not* be emitted until after the next call to :obj:`~gi.repository.Gtk.NativeDialog.show`. If the dialog is not visible this does nothing. .. method:: set_modal(modal: bool) -> None 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 :obj:`~gi.repository.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. :param modal: whether the window is modal .. method:: set_title(title: str) -> None Sets the title of the ``GtkNativeDialog.`` :param title: title of the dialog .. method:: set_transient_for(parent: ~gi.repository.Gtk.Window | None = None) -> None 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 :const:`None` for ``parent`` unsets the current transient window. :param parent: parent window .. method:: show() -> None Shows the dialog on the display. When the user accepts the state of the dialog the dialog will be automatically hidden and the :obj:`~gi.repository.Gtk.NativeDialog.signals.response` signal will be emitted. Multiple calls while the dialog is visible will be ignored. Properties ---------- .. rst-class:: interim-class .. class:: NativeDialog :no-index: .. attribute:: props.modal :type: bool Whether the window should be modal with respect to its transient parent. .. attribute:: props.title :type: str The title of the dialog window .. attribute:: props.transient_for :type: ~gi.repository.Gtk.Window The transient parent of the dialog, or :const:`None` for none. .. attribute:: props.visible :type: bool Whether the window is currently visible. Signals ------- .. rst-class:: interim-class .. class:: NativeDialog.signals :no-index: .. method:: response(response_id: int) -> None Emitted when the user responds to the dialog. When this is called the dialog has been hidden. If you call :obj:`~gi.repository.Gtk.NativeDialog.hide` before the user responds to the dialog this signal will not be emitted. :param response_id: the response ID Virtual Methods --------------- .. rst-class:: interim-class .. class:: NativeDialog :no-index: .. method:: do_hide() -> None Hides the dialog if it is visible, aborting any interaction. Once this is called the :obj:`~gi.repository.Gtk.NativeDialog.signals.response` signal will *not* be emitted until after the next call to :obj:`~gi.repository.Gtk.NativeDialog.show`. If the dialog is not visible this does nothing. .. method:: do_response(response_id: int) -> None class handler for the ``GtkNativeDialog::response`` signal :param response_id: .. method:: do_show() -> None Shows the dialog on the display. When the user accepts the state of the dialog the dialog will be automatically hidden and the :obj:`~gi.repository.Gtk.NativeDialog.signals.response` signal will be emitted. Multiple calls while the dialog is visible will be ignored. Fields ------ .. rst-class:: interim-class .. class:: NativeDialog :no-index: .. attribute:: parent_instance