package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Dialog

type t = [ `dialog | `window | `widget | `initially_unowned | `object_ ] Gobject.obj
val new_ : unit -> t

Create a new Dialog

val set_response_sensitive : t -> int -> bool -> unit

A convenient way to sensitize/desensitize dialog buttons.

Calls `gtk_widget_set_sensitive (widget, @setting)` for each widget in the dialog’s action area with the given @response_id.

val set_default_response : t -> int -> unit

Sets the default widget for the dialog based on the response ID.

Pressing “Enter” normally activates the default widget.

val response : t -> int -> unit

Emits the ::response signal with the given response ID.

Used to indicate that the user has responded to the dialog in some way.

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

Gets the widget button that uses the given response ID in the action area of a dialog.

val get_response_for_widget : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> int

Gets the response id of a widget in the action area of a dialog.

val get_header_bar : t -> [ `header_bar | `widget | `initially_unowned | `object_ ] Gobject.obj

Returns the header bar of @dialog.

Note that the headerbar is only used by the dialog if the property@Gtk.Dialog:use-header-bar property is %TRUE.

val get_content_area : t -> [ `box | `widget | `initially_unowned | `object_ ] Gobject.obj

Returns the content area of @dialog.

val add_button : t -> string -> int -> [ `widget | `initially_unowned | `object_ ] Gobject.obj

Adds a button with the given text.

GTK arranges things so that clicking the button will emit the signal@Gtk.Dialog::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.

val add_action_widget : t -> [ `widget | `initially_unowned | `object_ ] Gobject.obj -> int -> unit

Adds an activatable widget to the action area of a `GtkDialog`.

GTK connects a signal handler that will emit the signal@Gtk.Dialog::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 `GtkDialog` struct.

val get_use_header_bar : t -> int

Get property: use-header-bar

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