GtkScale: GtkScale

Description Methods and Functions Hierarchy Interfaces Detailed Description GtkScale as GtkBuildable Structures Signals Properties Style Properties Author(s) References

Description

Base class for GtkHScale and GtkVScale

Methods and Functions

gtkScaleSetDigits(object, digits)
gtkScaleSetDrawValue(object, draw.value)
gtkScaleSetValuePos(object, pos)
gtkScaleGetDigits(object)
gtkScaleGetDrawValue(object)
gtkScaleGetValuePos(object)
gtkScaleGetLayout(object)
gtkScaleGetLayoutOffsets(object)
gtkScaleAddMark(object, value, position, markup = NULL)
gtkScaleClearMarks(object)

Hierarchy

1
2
3
4
5
6
7
8
GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkRange
                           +----GtkScale
                                 +----GtkHScale
                                 +----GtkVScale

Interfaces

GtkScale implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Detailed Description

A GtkScale is a slider control used to select a numeric value. To use it, you'll probably want to investigate the methods on its base class, GtkRange, in addition to the methods for GtkScale itself. To set the value of a scale, you would normally use gtkRangeSetValue. To detect changes to the value, you would normally use the "value_changed" signal.

The GtkScale widget is an abstract class, used only for deriving the subclasses GtkHScale and GtkVScale. To create a scale widget, call gtkHScaleNewWithRange or gtkVScaleNewWithRange.

GtkScale as GtkBuildable

GtkScale supports a custom <marks> element, which can contain multiple <mark> elements. The "value" and "position" attributes have the same meaning as gtkScaleAddMark 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.

Structures

GtkScale

The fields of the GtkScale struct should only be accessed via the accessor functions.

Signals

format-value(scale, value, user.data)

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<–".

format_value_callback <- function(scale, value)
{
  return(paste("-->", format(value, nsmall=scale$getDigits()), "<--"), sep="")
}
scale

the object which received the signal

value

the value to format

user.data

user data set when the signal handler was connected.

Returns: [character] allocated string representing value

Properties

digits [integer : Read / Write]

The number of decimal places that are displayed in the value. Allowed values: [-1,64] Default value: 1

draw-value [logical : Read / Write]

Whether the current value is displayed as a string next to the slider. Default value: TRUE

value-pos [GtkPositionType : Read / Write]

The position in which the current value is displayed. Default value: GTK_POS_TOP

Style Properties

slider-length [integer : Read]

Length of scale's slider. Allowed values: >= 0 Default value: 31

value-spacing [integer : Read]

Space between value text and the slider/trough area. Allowed values: >= 0 Default value: 2

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gtk2/stable/GtkScale.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.

Related to GtkScale in RGtk2...