Overview

../GtkScale is a slider control used to select numeric values.

screenshot.png

Style Properties

Name

Default

Description

slider-length

31

Length of scale's slider

value-spacing

2

Space between value text and the slider/trough area

Also important are the style properties of GtkRange:

Name

Default

Description

slider-width

14

Width of scrollbar or scale thumb

trough-border

1

Spacing between thumb/steppers and outer trough bevel

stepper-size

14

Length of step buttons at ends

stepper-spacing

0

Spacing between step buttons and thumb

arrow-displacement-x

0

How far in the x direction to move the arrow when the button is depressed

arrow-displacement-y

0

How far in the y direction to move the arrow when the button is depressed

activate_slider

FALSE

With this option set to TRUE, sliders will be drawn ACTIVE and with shadow IN while they are dragged (Since 2.10)

trough-side-details

FALSE

When TRUE, the parts of the trough on the two sides of the slider are drawn with different details (Since 2.10)

trough-under-steppers

TRUE

Whether to draw trought for full length of range or exclude the steppers and spacing (Since 2.10)

The trough-under-steppers style property is not used by ../GtkScale, as it does not have any steppers.

Geometry

geometry.png

The stepper-spacing property does not have any effect any more from GTK+ 2.12 (?) onwards. It is only used if steppers are visible, and trough-under-steppers is set (for eg. ../GtkScrollbar).

Drawing

Trough

trough-side-details not set

The trough is a box drawn with shadow IN and its state either ACTIVE or INSENSITIVE. The detail string used is "trough".

trough-side-details set

Similar to above, but instead of just drawing the trough once, the two parts of the trough on each of the slider are drawn with a different detail string. The lower part has the detail "trough-lower" and the upper part detail "trough-upper".

Fill Levels

From GTK+ 2.12 on there is support for fill levels. This can eg. be used by the application to show how much of a video has been downloaded. The fill level indication is drawn with a detail of "trough-fill-level" or "trough-fill-level-full" when everything is filled. The shadow is OUT and the state either ACTIVE or INSENSITIVE.

Slider

How the slider is drawn depends on different aspects. The detail is "hscale" or "vscale" depending on the orientation (should check if this got changed at some point). The slider is drawn INSENSITIVE if the widget is insensitive and PRELIGHT if the mouse is on top of the slider. Both of these states have a shadow of OUT. If the user drags the slider, the behaviour depends on the activate-slider style property. If it is not set, then the a dragged slider will be drawn the same as a prelighted one. However, if set the slider will be drawn with state ACTIVE and shadow IN to give the user feedback that the slider is being moved.

Focus

The focus is drawn with a detail of "trough".

GTK+ API Documentation

http://library.gnome.org/devel/gtk/stable/GtkScale.html You might also want to have a look at the documentation of GtkRange http://library.gnome.org/devel/gtk/stable/GtkRange.html

Attic/GnomeArt/Tutorials/GtkThemes/GtkScale (last edited 2013-11-27 14:33:54 by WilliamJonMcCann)