Package: gtk

Class gtk-scale

Superclasses

gtk-range, gtk-widget, g-initially-unowned, gtk-buildable, gtk-orientable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

digits
The digits property of type :int (Read / Write)
The number of decimal places that are displayed in the value.
Allowed values: [-1, 64]
Default value: 1
draw-value
The draw-value property of type :boolean (Read / Write)
Whether the current value is displayed as a string next to the slider.
Default value: true
has-origin
The has-origin property of type :boolean (Read / Write)
Whether the scale has an origin.
Default value: true
value-pos
The value-pos property of type gtk-position-type (Read / Write)
The position in which the current value is displayed.
Default value: :top

Details

A gtk-scale is a slider control used to select a numeric value. To use it, you will probably want to investigate the methods on its base class, gtk-range, in addition to the methods for gtk-scale itself. To set the value of a scale, you would normally use the function gtk-range-set-value. 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, 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 GtkBuildable

gtk-scale supports a custom <marks> element, which can contain multiple <mark> elements. The "value" and "position" attributes have the same meaning as gtk-scale-add-mark parameters of the same name. If the element is not empty, its content is taken as the markup to show at the mark. It can be translated with the usual "translatable" and "context" attributes.

Style Property Details

slider-length
The slider-length style property of type :int (Read)
Length of scale's slider.
Warning: The slider-length style property has been deprecated since version 3.20 and should not be used in newly-written code. Use min-height/min-width CSS properties on the slider element instead. The value of this style property is ignored.
Allowed values: >= 0
Default value: 31
value-spacing
The value-spacing style property of type :int (Read)
Space between value text and the slider/trough area.
Warning: The value-spacing style property has been deprecated since version 3.20 and should not be used in newly-written code. Use min-height/min-width CSS properties on the value element instead. The value of this style property is ignored.
Allowed values: >= 0
Default value: 2

Signal Details

The "format-value" signal
 lambda (scale value)   : Run Last      
Signal 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. Here's 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);
 }      
scale
The object which received the signal.
value
The value to format.
Returns
Allocated string representing value.
 

Slot Access Functions

Inherited Slot Access Functions

2013-4-28