package ocgtk

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

Module Wrappers.Range

type t = [ `range | `widget | `initially_unowned | `object_ ] Gobject.obj
val set_value : t -> float -> unit

Sets the current value of the range.

If the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The range emits the signal@Gtk.Range::value-changed signal if the value changes.

val set_slider_size_fixed : t -> bool -> unit

Sets whether the range’s slider has a fixed size, or a size that depends on its adjustment’s page size.

This function is useful mainly for `GtkRange` subclasses.

val set_show_fill_level : t -> bool -> unit

Sets whether a graphical fill level is show on the trough.

See method@Gtk.Range.set_fill_level for a general description of the fill level concept.

val set_round_digits : t -> int -> unit

Sets the number of digits to round the value to when it changes.

See signal@Gtk.Range::change-value.

val set_restrict_to_fill_level : t -> bool -> unit

Sets whether the slider is restricted to the fill level.

See method@Gtk.Range.set_fill_level for a general description of the fill level concept.

val set_range : t -> float -> float -> unit

Sets the allowable values in the `GtkRange`.

The range value is clamped to be between @min and @max. (If the range has a non-zero page size, it is clamped between @min and @max - page-size.)

val set_inverted : t -> bool -> unit

Sets whether to invert the range.

Ranges normally move from lower to higher values as the slider moves from top to bottom or left to right. Inverted ranges have higher values at the top or on the right rather than on the bottom or left.

val set_increments : t -> float -> float -> unit

Sets the step and page sizes for the range.

The step size is used when the user clicks the `GtkScrollbar` arrows or moves a `GtkScale` via arrow keys. The page size is used for example when moving via Page Up or Page Down keys.

val set_flippable : t -> bool -> unit

Sets whether the `GtkRange` respects text direction.

If a range is flippable, it will switch its direction if it is horizontal and its direction is %GTK_TEXT_DIR_RTL.

See method@Gtk.Widget.get_direction.

val set_fill_level : t -> float -> unit

Set the new position of the fill level indicator.

The “fill level” is probably best described by its most prominent use case, which is an indicator for the amount of pre-buffering in a streaming media player. In that use case, the value of the range would indicate the current play position, and the fill level would be the position up to which the file/stream has been downloaded.

This amount of prebuffering can be displayed on the range’s trough and is themeable separately from the trough. To enable fill level display, use method@Gtk.Range.set_show_fill_level. The range defaults to not showing the fill level.

Additionally, it’s possible to restrict the range’s slider position to values which are smaller than the fill level. This is controlled by method@Gtk.Range.set_restrict_to_fill_level and is by default enabled.

val set_adjustment : t -> [ `adjustment | `initially_unowned | `object_ ] Gobject.obj -> unit

Sets the adjustment to be used as the “model” object for the `GtkRange`

The adjustment indicates the current range value, the minimum and maximum range values, the step/page increments used for keybindings and scrolling, and the page size.

The page size is normally 0 for `GtkScale` and nonzero for `GtkScrollbar`, and indicates the size of the visible area of the widget being scrolled. The page size affects the size of the scrollbar slider.

val get_value : t -> float

Gets the current value of the range.

val get_slider_size_fixed : t -> bool

This function is useful mainly for `GtkRange` subclasses.

See method@Gtk.Range.set_slider_size_fixed.

val get_slider_range : t -> int * int

This function returns sliders range along the long dimension, in widget->window coordinates.

This function is useful mainly for `GtkRange` subclasses.

val get_show_fill_level : t -> bool

Gets whether the range displays the fill level graphically.

val get_round_digits : t -> int

Gets the number of digits to round the value to when it changes.

See signal@Gtk.Range::change-value.

val get_restrict_to_fill_level : t -> bool

Gets whether the range is restricted to the fill level.

val get_range_rect : t -> Ocgtk_gdk.Gdk.Wrappers.Rectangle.t

This function returns the area that contains the range’s trough, in coordinates relative to @range's origin.

This function is useful mainly for `GtkRange` subclasses.

val get_inverted : t -> bool

Gets whether the range is inverted.

See method@Gtk.Range.set_inverted.

val get_flippable : t -> bool

Gets whether the `GtkRange` respects text direction.

See method@Gtk.Range.set_flippable.

val get_fill_level : t -> float

Gets the current position of the fill level indicator.

val get_adjustment : t -> [ `adjustment | `initially_unowned | `object_ ] Gobject.obj

Get the adjustment which is the “model” object for `GtkRange`.

val on_adjust_bounds : ?after:bool -> t -> callback:(value:float -> unit) -> Gobject.Signal.handler_id
val on_change_value : ?after:bool -> t -> callback:(scroll:Gtk_enums.scrolltype -> value:float -> bool) -> Gobject.Signal.handler_id
val on_move_slider : ?after:bool -> t -> callback:(step:Gtk_enums.scrolltype -> unit) -> Gobject.Signal.handler_id
val on_value_changed : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id