#! /usr/sgitcl/bin/moat xtAppInitialize xmMainWindow .main managed xmScale .main.slide managed -orientation horizontal \ -maximum 11 -value 11 -showValue True \ -titleString "Volume" . realizeWidget . mainLoop
Figure 4-6 : xmScale Horizontal Slider The xmScale widget class defines the new resources, as shown in Table 4-34.
The slider may be moved between the integer -minimum and -maximum. Fractional values are obtained using the -decimalPoints resource, to display a decimal point. The slider size may be set by -scaleHeight and -scaleWidth. The resource -showValue toggles display of text showing the current value, while -scaleMultiple is used for large slider moves with a <Ctrl>-Arrow key.
Table 4-35 lists callbacks defined for the xmScale widget.
Method Name | Why |
---|---|
valueChangedCallback | The scale value had changed. |
dragCallback | The slider is being dragged. |
In addition, xmScale inherits the usual helpCallback from the Primitive abstract class.
In these callbacks, %value substitution may be used to retrieve the current scale position.