1.129 <GtkNativeDialog>

Class: <GtkNativeDialog>

It derives from <GObject>.

Base class for platform dialogs that don’t use GtkDialog.

Native dialogs are used in order to integrate better with a platform, by looking the same as other native applications and supporting platform specific features.

The <GtkDialog> 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 native-dialog: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.

Fields

parent-instance

Properties

Property: native-dialog:modal self

Whether the window should be modal with respect to its transient parent.

Its value is a boolean.

Set it with (set! (native-dialog:modal self) value).

Property: native-dialog:title self

The title of the dialog window

Its value is a string, or #f.

Set it with (set! (native-dialog:title self) value).

Property: native-dialog:transient-for self

The transient parent of the dialog, or #f for none.

Its value is a <GtkWindow>, or #f.

Set it with (set! (native-dialog:transient-for self) value).

Property: native-dialog:visible self

Whether the window is currently visible.

Its value is a boolean.

Set it with (set! (native-dialog:visible self) value).

Procedures

Method: native-dialog:destroy self
Method: destroy self

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

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

Method: native-dialog:get-modal? self ⇒ %return
Method: get-modal? self ⇒ %return

Returns whether the dialog is modal.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

%return

Returned: a boolean.

#t if the dialog is set to be modal

Method: native-dialog:get-title self ⇒ %return
Method: get-title self ⇒ %return

Gets the title of the <GtkNativeDialog>.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

%return

Returned: a string, or #f.

the title of the dialog, or #f if none has been set explicitly. The returned string is owned by the widget and must not be modified or freed.

Method: native-dialog:get-transient-for self ⇒ %return
Method: get-transient-for self ⇒ %return

Fetches the transient parent for this window.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

%return

Returned: a <GtkWindow>, or #f.

the transient parent for this window, or #f if no transient parent has been set.

Method: native-dialog:get-visible? self ⇒ %return
Method: get-visible? self ⇒ %return

Determines whether the dialog is visible.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

%return

Returned: a boolean.

#t if the dialog is visible

Method: native-dialog:hide self
Method: hide self

Hides the dialog if it is visible, aborting any interaction.

Once this is called the native-dialog:response signal will not be emitted until after the next call to native-dialog:show.

If the dialog is not visible this does nothing.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

Method: native-dialog:set-modal self modal
Method: set-modal self 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 native-dialog:set-transient-for to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

modal

Passed: a boolean.

whether the window is modal

Method: native-dialog:set-title self title
Method: set-title self title

Sets the title of the GtkNativeDialog.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

title

Passed: a string.

title of the dialog

Method: native-dialog:set-transient-for self [parent]
Method: set-transient-for self [parent]

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 #f for parent unsets the current transient window.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

parent

Passed, or left out: a <GtkWindow>, or #f.

parent window

Method: native-dialog:show self
Method: show self

Shows the dialog on the display.

When the user accepts the state of the dialog the dialog will be automatically hidden and the native-dialog:response signal will be emitted.

Multiple calls while the dialog is visible will be ignored.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

Signals

Signal: native-dialog:response

Connect a handler with (connect object native-dialog:response handler). It is called as (handler self response-id).

Emitted when the user responds to the dialog.

When this is called the dialog has been hidden.

If you call native-dialog:hide before the user responds to the dialog this signal will not be emitted.

self

Passed: a <GtkNativeDialog>.

response-id

Passed: a 32-bit integer.

the response ID

Virtual methods

Virtual method: native-dialog:do-hide implementor self

Hides the dialog if it is visible, aborting any interaction.

Once this is called the native-dialog:response signal will not be emitted until after the next call to native-dialog:show.

If the dialog is not visible this does nothing.

To override it in a new class, give register-type #:vfuncs `((hide . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkNativeDialog>, or a class that derives from it, or its GType number.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>

Virtual method: native-dialog:do-response implementor self response-id

class handler for the native-dialog:response signal

To override it in a new class, give register-type #:vfuncs `((response . ,procedure)). The procedure is called as (procedure self response-id).

implementor

Passed: the class whose implementation to call: <GtkNativeDialog>, or a class that derives from it, or its GType number.

self

Passed: a <GtkNativeDialog>.

response-id

Passed: a 32-bit integer.

Virtual method: native-dialog:do-show implementor self

Shows the dialog on the display.

When the user accepts the state of the dialog the dialog will be automatically hidden and the native-dialog:response signal will be emitted.

Multiple calls while the dialog is visible will be ignored.

To override it in a new class, give register-type #:vfuncs `((show . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <GtkNativeDialog>, or a class that derives from it, or its GType number.

self

Passed: a <GtkNativeDialog>.

a <GtkNativeDialog>