View Full Version : How to update a slider ?

04-27-2010, 08:38 AM

I'm using a slider created by :

wid_slider = WwControlsBox(layoutLeft, '', [0, 100], 'slider_CB')

I need to modify it's value (for example, set it to 50) , so I tried :

status = WwSetValue(wid_slider, 50)

But it give me an error : "WwError: Value NOT supported FOR this widget class"

In the documentation, I found (in WwControlsBox section) :

setvalue?Sets the value of the selected slider

How can I "select" the slider to edit it's value ?


04-28-2010, 09:13 AM
Hi, this widget is a bit tricky to get a hang of.
The wwcontrolsbox widget is the parent widget to a number of sliders, each of which have their own widgetId. The slider widgetIds are returned with the "sliders" optional output keyword. You have to use wwsetvalue with the widgetId of the _Slider_ that you want to update.



controls = WwControlsBox(layout, labels, $
ranges, 'SliderCB',/Vertical,/Text, $
Foreground='gray',Background='white', $
Basecolor='blue', Sliders=s)

status = wwsetvalue(s(0), 50)

04-28-2010, 11:27 PM
Thanks a lot !