package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Scale/index.html
Module Wrappers.Scale
type t =
[ `scale | `range | `widget | `initially_unowned | `object_ ] Gobject.objval new_ :
Gtk_enums.orientation ->
[ `adjustment | `initially_unowned | `object_ ] Gobject.obj option ->
tCreate a new Scale
val new_with_range : Gtk_enums.orientation -> float -> float -> float -> tCreate a new Scale
val set_value_pos : t -> Gtk_enums.positiontype -> unitSets the position in which the current value is displayed.
val set_has_origin : t -> bool -> unitSets whether the scale has an origin.
If property@Gtk.Scale:has-origin is set to %TRUE (the default), the scale will highlight the part of the trough between the origin (bottom or left side) and the current value.
val set_draw_value : t -> bool -> unitSpecifies whether the current value is displayed as a string next to the slider.
val set_digits : t -> int -> unitSets the number of decimal places that are displayed in the value.
Also causes the value of the adjustment to be rounded to this number of digits, so the retrieved value matches the displayed one, if property@Gtk.Scale:draw-value is %TRUE when the value changes. If you want to enforce rounding the value when property@Gtk.Scale:draw-value is %FALSE, you can set property@Gtk.Range:round-digits instead.
Note that rounding to a small number of digits can interfere with the smooth autoscrolling that is built into `GtkScale`. As an alternative, you can use method@Gtk.Scale.set_format_value_func to format the displayed value yourself.
val get_value_pos : t -> Gtk_enums.positiontypeGets the position in which the current value is displayed.
val get_layout_offsets : t -> int * intObtains the coordinates where the scale will draw the `PangoLayout` representing the text in the scale.
Remember when using the `PangoLayout` function you need to convert to and from pixels using `PANGO_PIXELS()` or `PANGO_SCALE`.
If the property@Gtk.Scale:draw-value property is %FALSE, the return values are undefined.
val get_layout : t -> Ocgtk_pango.Pango.Wrappers.Layout.t optionGets the `PangoLayout` used to display the scale.
The returned object is owned by the scale so does not need to be freed by the caller.
val get_has_origin : t -> boolReturns whether the scale has an origin.
val get_draw_value : t -> boolReturns whether the current value is displayed as a string next to the slider.
val get_digits : t -> intGets the number of decimal places that are displayed in the value.
val clear_marks : t -> unitRemoves any marks that have been added.
val add_mark : t -> float -> Gtk_enums.positiontype -> string option -> unitAdds a mark at @value.
A mark is indicated visually by drawing a tick mark next to the scale, and GTK makes it easy for the user to position the scale exactly at the marks value.
If @markup is not %NULL, text is shown next to the tick mark.
To remove marks from a scale, use method@Gtk.Scale.clear_marks.