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

Module Wrappers.Adjustment

type t = [ `adjustment | `initially_unowned | `object_ ] Gobject.obj
val new_ : float -> float -> float -> float -> float -> float -> t

Create a new Adjustment

val set_value : t -> float -> unit

Sets the `GtkAdjustment` value.

The value is clamped to lie between property@Gtk.Adjustment:lower and property@Gtk.Adjustment:upper.

Note that for adjustments which are used in a `GtkScrollbar`, the effective range of allowed values goes from property@Gtk.Adjustment:lower to property@Gtk.Adjustment:upper - property@Gtk.Adjustment:page-size.

val set_upper : t -> float -> unit

Sets the maximum value of the adjustment.

Note that values will be restricted by `upper - page-size` if the page-size property is nonzero.

See method@Gtk.Adjustment.set_lower about how to compress multiple emissions of the signal@Gtk.Adjustment::changed signal when setting multiple adjustment properties.

val set_step_increment : t -> float -> unit

Sets the step increment of the adjustment.

See method@Gtk.Adjustment.set_lower about how to compress multiple emissions of the signal@Gtk.Adjustment::changed signal when setting multiple adjustment properties.

val set_page_size : t -> float -> unit

Sets the page size of the adjustment.

See method@Gtk.Adjustment.set_lower about how to compress multiple emissions of the signal@Gtk.Adjustment::changed signal when setting multiple adjustment properties.

val set_page_increment : t -> float -> unit

Sets the page increment of the adjustment.

See method@Gtk.Adjustment.set_lower about how to compress multiple emissions of the signal@Gtk.Adjustment::changed signal when setting multiple adjustment properties.

val set_lower : t -> float -> unit

Sets the minimum value of the adjustment.

When setting multiple adjustment properties via their individual setters, multiple signal@Gtk.Adjustment::changed signals will be emitted. However, since the emission of the signal@Gtk.Adjustment::changed signal is tied to the emission of the ::notify signals of the changed properties, it’s possible to compress the signal@Gtk.Adjustment::changed signals into one by calling g_object_freeze_notify() and g_object_thaw_notify() around the calls to the individual setters.

Alternatively, using a single g_object_set() for all the properties to change, or using method@Gtk.Adjustment.configure has the same effect.

val get_value : t -> float

Gets the current value of the adjustment.

val get_upper : t -> float

Retrieves the maximum value of the adjustment.

val get_step_increment : t -> float

Retrieves the step increment of the adjustment.

val get_page_size : t -> float

Retrieves the page size of the adjustment.

val get_page_increment : t -> float

Retrieves the page increment of the adjustment.

val get_minimum_increment : t -> float

Gets the smaller of step increment and page increment.

val get_lower : t -> float

Retrieves the minimum value of the adjustment.

val configure : t -> float -> float -> float -> float -> float -> float -> unit

Sets all properties of the adjustment at once.

Use this function to avoid multiple emissions of the signal@Gtk.Adjustment::changed signal. See method@Gtk.Adjustment.set_lower for an alternative way of compressing multiple emissions of signal@Gtk.Adjustment::changed into one.

val clamp_page : t -> float -> float -> unit

Updates the value property to ensure that the range between @lower and @upper is in the current page.

The current page goes from `value` to `value` + `page-size`. If the range is larger than the page size, then only the start of it will be in the current page.

A signal@Gtk.Adjustment::value-changed signal will be emitted if the value is changed.

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