Re: Changing maximum of slider [message #6704] |
Thu, 08 August 1996 00:00 |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Ok, if all you want to do is change the range of values returned by
a cw_fslider() widget, this will definitely work
wid = cw_fslider( ... )
widget_control, widget_info( wid, /child ), get_uvalue = state, /no_copy
state.top = new_max
state.bot = new_min
widget_control, widget_info( wid, /child ), set_uvalue = state, /no_copy
This will not change the label if the value displayed is outside the
new range of values. However, you could do that as well by calculating
what the value should be and using
widget_control, state.labelid, $
set_value = string( new_label, format = state.format )
My apologies for the quick posting earlier which incorrectly said
to change the actual slider min and max limits.
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|
Re: Changing maximum of slider [message #6708 is a reply to message #6704] |
Thu, 08 August 1996 00:00  |
dwu
Messages: 14 Registered: November 1995
|
Junior Member |
|
|
Thank you for your method. But this only changes label of the slider
(maybe only the slider_min, not the slider_max, since the length is
fixed), cannot change the calculation of the slider.
Maybe just writing another cw_slider.pro is a good solution.
Maybe I'm wrong, I haven't try your method yet.
Thanks again.
Robert Moss (mossrm@texaco.com) wrote:
: ; x = new slider max, y = new slider min
: widget_control, widget_info( wid, /child ), get_uvalue = state, /no_copy
: widget_control, state.slideid, set_slider_max = x, set_slider_max = y
: state.top = x ;update the cw_slider state structure
: state.bot = y
: widget_control, widget_info( wid, /child ), set_uvalue = state, /no_copy
:
: I havent tried this, but I'd say its definitely worth a shot...
:
: Robert
|
|
|
Re: Changing maximum of slider [message #6713 is a reply to message #6704] |
Wed, 07 August 1996 00:00  |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Ding Wu wrote:
>
>
> If wid=cw_fslider(),
> do you know how to change the max and min ?
>
heh.. this gets tricky. You can try this:
; wid is the widget id of the cw_slider widget
wid = cw_slider( .. )
; x = new slider max, y = new slider min
widget_control, widget_info( wid, /child ), get_uvalue = state, /no_copy
widget_control, state.slideid, set_slider_max = x, set_slider_max = y
state.top = x ;update the cw_slider state structure
state.bot = y
widget_control, widget_info( wid, /child ), set_uvalue = state, /no_copy
I havent tried this, but I'd say its definitely worth a shot...
Robert
|
|
|
Re: Changing maximum of slider [message #6718 is a reply to message #6713] |
Wed, 07 August 1996 00:00  |
Ralf Loeffler
Messages: 1 Registered: August 1996
|
Junior Member |
|
|
Jorn Helbert wrote:
>
> Hi,
> is there any way to change the maximum of a slider-widget during
> run-time?
> I have a slider which denotes the plane of a cut through a 3-dim.
> structure. But I don't have the same number of cuts in all three
> dimensions. So I would like to be able to change the maximum according
> to the direction.
>
Hi,
I had the same problem, and even better also have the solution:
you can just do it by using:
widget_control, SLIDER_NAME, set_slider_max=DIMENSION
--
Ralf Loeffler MED MRA 2, Siemens AG.,
Germany
loeffler@scn.de <http://www.scn.de/~loeffler> +49 9131 84
8061
|
|
|
Re: Changing maximum of slider [message #6721 is a reply to message #6713] |
Tue, 06 August 1996 00:00  |
dwu
Messages: 14 Registered: November 1995
|
Junior Member |
|
|
Robert Moss (mossrm@texaco.com) wrote:
:
: ;Slider widget id = wid
: widget_control, wid, set_slider_max = x, set_slider_min = y
:
: mm = widget_info( wid, /slider_min_max )
: ;mm contains slider endpoints
If wid=cw_fslider(),
do you know how to change the max and min ?
:
: --
: Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
: ------------------------------------------------------------ -----
: This does not necessarily reflect the opinions of Texaco Inc.
|
|
|
Re: Changing maximum of slider [message #6722 is a reply to message #6721] |
Tue, 06 August 1996 00:00  |
Robert Moss
Messages: 74 Registered: February 1996
|
Member |
|
|
Jorn Helbert wrote:
>
> Hi,
> is there any way to change the maximum of a slider-widget during
> run-time?
> I have a slider which denotes the plane of a cut through a 3-dim.
> structure. But I don't have the same number of cuts in all three
> dimensions. So I would like to be able to change the maximum according
> to the direction.
>
> --
> Joern Helbert
>
> Space and atmospheric physics group
> Imperial College - London
> phone: 0171 594-7764
;Slider widget id = wid
widget_control, wid, set_slider_max = x, set_slider_min = y
mm = widget_info( wid, /slider_min_max )
;mm contains slider endpoints
--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
|
|
|