Next: , Previous: GtkEntryCompletion, Up: Top

22 GtkHScale

A horizontal slider widget for selecting a value from a range

22.1 Overview

The <gtk-hscale> widget is used to allow the user to select a value using a horizontal slider. To create one, use gtk-hscale-new-with-range.

The position to show the current value, and the number of decimal places shown can be set using the parent <gtk-scale> class's functions.

22.2 Usage

— Class: <gtk-hscale>

Derives from <gtk-scale>.

This class defines no direct slots.

— Function: gtk-hscale-new (adjustment <gtk-adjustment>) ⇒  (ret <gtk-widget>)

Creates a new <gtk-hscale>.

the <gtk-adjustment> which sets the range of the scale.
a new <gtk-hscale>.
— Function: gtk-hscale-new-with-range (min double) (max double) (step double) ⇒  (ret <gtk-widget>)

Creates a new horizontal scale widget that lets the user input a number between min and max (including min and max) with the increment step. step must be nonzero; it's the distance the slider moves when using the arrow keys to adjust the scale value.

Note that the way in which the precision is derived works best if step is a power of ten. If the resulting precision is not suitable for your needs, use gtk-scale-set-digits to correct it.

minimum value
maximum value
step increment (tick size) used with keyboard shortcuts
a new <gtk-hscale>