Next: Scale Callbacks Up: Scale Widgets Previous: Scale Widgets

Scale basics

To create a Scale Widget use XtVaCreateManagedWidget() with a xmScaleWidgetClass class pointer or use XmCreateScale().

The following Scale Widget Resources are useful:

XmNmaximum
- The largest value of scale,
XmNminimum
- Scale's smallest value (default 0),
XmNorientation
- XmHORIZONTAL or XmVERTICAL,
XmNtitleString
- The XmString label of scale,

XmNdecimalPoints
- A scale value is always returned as an integer (default 0). This resource can be set to give the user the impression of floating point input. e.g If we have a range 0 - 1000 on the Scale but XmNdecimalPoints set to 2. The displayed range would be 0.00 - 10.00.

You the programmer must take care of the input value to the program. In the above a value will still get returned in the integer range and somewhere there must be a division by 100.

XmNshowValue
- True or False. This resource decides whether or not to display the value of the scale as it moves.

XmNvalue
- The current value (int) of the Scale.

XmNprocessingDirection
- Either XmMAX_ON_TOP, XmMAX_ON_BOTTOM, XmMAX_ON_LEFT or XmMAX_ON_RIGHT. This resource sets the end of the scale where the max and min values are placed. This depends on the orientation of the Scale.


Dave.Marshall@cm.cf.ac.uk
Tue May 24 16:52:56 BST 1994