Chapter 14. Adjustments

## Chapter 14. Adjustments

gtkmm has various widgets that can be visually adjusted using the mouse or the keyboard, such as the `Range` widgets (described in the Range Widgets section). There are also a few widgets that display some adjustable part of a larger area, such as the `Viewport` widget. These widgets have `Gtk::Adjustment` objects that express this common part of their API.

So that applications can react to changes, for instance when a user moves a scrollbar, `Gtk::Adjustment` has a `changed` signal. You can then use the `get_changed()` method to discover the new value.

## Creating an Adjustment

The `Gtk::Adjustment` constructor is as follows:

    Gtk::Adjustment(float value,
                    float lower,
                    float upper,
                    float step_increment = 1,
                    float page_increment = 10,
                    float page_size = 0);

The `value` argument is the initial value of the adjustment, usually corresponding to the topmost or leftmost position of an adjustable widget. The `lower` and `upper` arguments specifies the possible range of values which the adjustment can hold. The `step_increment` argument specifies the smaller of the two increments by which the user can change the value, while the `page_increment` is the larger one. The `page_size` argument usually corresponds somehow to the visible area of a panning widget. The `upper` argument is used to represent the bottom most or right most coordinate in a panning widget's child.

ToolPalette Example |  | Using Adjustments the Easy Way