Creating a Controls Box with Sliders
A controls box is a box containing “sliders”. A slider can change numerical values interactively by positioning the pointer on the slider, pressing the left mouse button, and dragging. A controls box can have any number of sliders oriented horizontally or vertically in a specified number of rows or columns. In addition, a slider can have an input text field.
A controls box is created with the WwControlsBox function.
Example
In this example, a controls box containing three sliders, labeled
Pressure,
RPM, and
Temperature, is created. The keyword
Text creates a text input field for each slider. When a slider is moved, the callback routine named
SliderCB is executed. The result is shown in
Figure 5-18: Controls Box.
top=WwInit('ww_ex9', 'Examples', layout)
; Create the slider labels.
labels=['Pressure','RPM','Temperature']
; Specify the ranges of each slider.
ranges=[0,100,2000,4000,50,150]
; Create the controls box.
controls = WwControlsBox(layout, labels, $
ranges, 'SliderCB',/Vertical, /Text, $
Foreground='red', Background='yellow', Basecolor='blue')
status=WwSetValue(top, /Display)
WwLoop