A Scale 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,
Range
, in addition to the methods for Scale itself. To set the
value of a scale, you would normally use
Range.setValue(double)
.
To detect changes to the value, add RangeListener object to the widget.
The GtkScale widget is an abstract class, used only for deriving the
subclasses
HScale
and
VScale
.
getDrawValue
public boolean getDrawValue()
Returns whether the current value is displayed as a string next
to the slider.
getEventListenerClass
public Class getEventListenerClass(String signal)
- getEventListenerClass in interface Range
getEventType
public EventType getEventType(String signal)
- getEventType in interface Range
getLayoutOffsetX
public int getLayoutOffsetX()
Obtains the X coordinate where the scale will draw the
Layout
representing the text in the scale.
If
getDrawValue()
is FALSE, the return value is undefined.
getLayoutOffsetY
public int getLayoutOffsetY()
Obtains the Y coordinate where the scale will draw the
Layout
representing the text in the scale.
If
getDrawValue()
is FALSE, the return value is undefined.
getType
public static Type getType()
Retrieve the runtime type used by the GLib library.
- getType in interface Range
gtk_scale_get_digits
protected static final int gtk_scale_get_digits(Handle scale)
gtk_scale_get_draw_value
protected static final boolean gtk_scale_get_draw_value(Handle scale)
gtk_scale_get_type
protected static final int gtk_scale_get_type()
gtk_scale_get_value_pos
protected static final int gtk_scale_get_value_pos(Handle scale)
gtk_scale_set_digits
protected static final void gtk_scale_set_digits(Handle scale,
int digits)
gtk_scale_set_draw_value
protected static final void gtk_scale_set_draw_value(Handle scale,
boolean drawValue)
gtk_scale_set_value_pos
protected static final void gtk_scale_set_value_pos(Handle scale,
int pos)
removeFormatListener
public void removeFormatListener()
Removes the format listener
setDigits
public void setDigits(int digits)
Sets the number of decimal places that are displayed in the value.
Also causes the value of the adjustment to be rounded off to this number
of digits, so the retrieved value matches the value the user saw.
digits
- The number of decimal places to display, e.g. use 1 to
display 1.0, 2 to display 1.00 etc.
setDrawValue
public void setDrawValue(boolean setting)
Specifies whether the current value is displayed as a string next to the slider.
setting
- If true, the value is displayed.
setFormatListener
public void setFormatListener(ScaleListener listener)
Sets a listener to be used when a format-value request is called.
setValuePosition
public void setValuePosition(PositionType pos)
Sets the position in which the current value is displayed.
pos
- The position in which the current value is displayed.