package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Native_dialog/index.html

Module Wrappers.Native_dialog

type t = [ `native_dialog | `object_ ] Gobject.obj
val show : t -> unit

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.

val set_transient_for : t -> [ `window | `widget | `initially_unowned | `object_ ] Gobject.obj option -> unit

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 %NULL for @parent unsets the current transient window.

val set_title : t -> string -> unit

Sets the title of the `GtkNativeDialog.`

val set_modal : t -> bool -> unit

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.

val hide : t -> unit

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.

val get_visible : t -> bool

Determines whether the dialog is visible.

val get_transient_for : t -> [ `window | `widget | `initially_unowned | `object_ ] Gobject.obj option

Fetches the transient parent for this window.

val get_title : t -> string option

Gets the title of the `GtkNativeDialog`.

val get_modal : t -> bool

Returns whether the dialog is modal.

val destroy : t -> unit

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

val on_response : ?after:bool -> t -> callback:(response_id:int -> unit) -> Gobject.Signal.handler_id