Scale Widgets
Prev | Chapter 5. Range Widgets | Next

## Scale Widgets

`Gtk::Scale` widgets (or "sliders") allow the user to visually select and manipulate a value within a specific range. You might use one, for instance, to adjust the magnification level on a zoomed preview of a picture, or to control the brightness of a colour, or to specify the number of minutes of inactivity before a screensaver takes over the screen.

As with `Scrollbars`, there are separate widget types for horizontal and vertical widgets - `Gtk::HScale` and `Gtk::VScale`. The default constructors create an `Adjustment` with all of its values set to `0.0`. This isn't useful so you will need to set some `Adjustment` details to get meaningful behaviour.

### Useful methods

`Scale` widgets can display their current value as a number next to the trough. By default they show the value, but you can change this with the `set_draw_value()` method.

The value displayed by a scale widget is rounded to one decimal point by default, as is the `value` field in its `Gtk::Adjustment`. You can change this with the `set_digits()` method.

Also, the value can be drawn in different positions relative to the trough, specified by the `set_value_pos()` method.

Reference

Prev | Up | Next
Chapter 5. Range Widgets | Home | Update Policies