package ocgtk

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

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