Package: gtk
Class gtk-scale
Superclassesgtk-range, gtk-widget, gtk-buildable, gtk-orientable, g-object, common-lisp:standard-object, common-lisp:t Documented Subclasses
None
Direct SlotsDetails A gtk-scale widget is a slider control used to select a numeric value.
To use it, you will probably want to investigate the methods on its base gtk-range class, in addition to the methods for the gtk-scale
class itself. To set the value of a scale, you would normally use the gtk-range-value function. To detect changes to the value, you would
normally use the "value-changed" signal. ![]() Note that using the same upper and lower bounds for the gtk-scale widget, through the gtk-range methods, will hide the slider itself. This is useful for applications that want to show an undeterminate value on the scale, without changing the layout of the application, such as movie or music players. GtkScale as GtkBuildableCSS nodesscale[.fine-tune][.marks-before][.marks-after] ├── marks.top │ ├── mark │ ┊ ├── [label] │ ┊ ╰── indicator ┊ ┊ │ ╰── mark ├── [value] ├── contents │ ╰── trough │ ├── slider │ ├── [highlight] │ ╰── [fill] ╰── marks.bottom ├── mark ┊ ├── indicator ┊ ╰── [label] ╰── markThe gtk-scale implementation has a main CSS node with name scale and a subnode for its contents, with subnodes named trough and slider. The main node gets the .fine-tune style class added when the scale is in 'fine-tuning' mode. If the scale has an origin, see the gtk-scale-has-origin function, there is a subnode with name highlight below the trough node that is used for rendering the highlighted part of the trough. If the scale is showing a fill level, see the gtk-range-show-fill-level function, there is a subnode with name fill below the trough node that is used for rendering the filled in part of the trough. If marks are present, there is a marks subnode before or after the contents node, below which each mark gets a node with name mark. The marks nodes get either the .top or .bottom style class. The mark node has a subnode named indicator. If the mark has text, it also has a subnode named label. When the mark is either above or left of the scale, the label subnode is the first when present. Otherwise, the indicator subnode is the first. The main CSS node gets the marks-before and/or marks-after style classes added depending on what marks are present. If the scale is displaying the value, see the draw-value property, there is subnode with name value. Style Property Details
Signal DetailsThe "format-value" signallambda (scale value) :run-lastSignal which allows you to change how the scale value is displayed. Connect a signal handler which returns an allocated string representing value. That string will then be used to display the scale's value. If no user provided handlers are installed, the value will be displayed on its own, rounded according to the value of the digits property. Here is an example signal handler which displays a value 1.0 as with "-->1.0<--". static gchar* format_value_callback (GtkScale *scale, gdouble value) { return g_strdup_printf ("-->%0.*g<--", gtk_scale_get_digits (scale), value); }
| Slot Access FunctionsInherited Slot Access FunctionsSee also |
*2021-12-27