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/Toggle_button/index.html

Module Wrappers.Toggle_button

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

Create a new ToggleButton

val new_with_label : string -> t

Create a new ToggleButton

val new_with_mnemonic : string -> t

Create a new ToggleButton

val toggled : t -> unit

Emits the ::toggled signal on the `GtkToggleButton`.

val set_group : t -> t option -> unit

Adds @self to the group of @group.

In a group of multiple toggle buttons, only one button can be active at a time.

Setting up groups in a cycle leads to undefined behavior.

Note that the same effect can be achieved via the iface@Gtk.Actionable API, by using the same action with parameter type and state type 's' for all buttons in the group, and giving each button its own target value.

val set_active : t -> bool -> unit

Sets the status of the toggle button.

Set to %TRUE if you want the `GtkToggleButton` to be “pressed in”, and %FALSE to raise it.

If the status of the button changes, this action causes the signal@Gtk.ToggleButton::toggled signal to be emitted.

val get_active : t -> bool

Queries a `GtkToggleButton` and returns its current state.

Returns %TRUE if the toggle button is pressed in and %FALSE if it is raised.

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