comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: change widget slider maximum dynamically?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: change widget slider maximum dynamically? [message #17588] Tue, 02 November 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Jason Brookes (jason.brookes@rmsb.u-bordeaux2.fr) writes
(after translation, please turn your HTML code generator
off, Jason!):

> Is it not just a case of using Widget Control's "set_slider_max"
> keyword ? eg:
>
> WIDGET_CONTROL,(*(*ptr).widget_info_ptr).slider,SET_SLIDER_M AX = new_max_value
>
> Incidentally, the online IDL (5.2) help states that...
> "Note: This keyword does not apply to floating-point sliders created with
> the CW_FSLIDER function."
>
> This is not actually true, it applies equally well
> to floating-point sliders. RSI just haven't got
> round to changing their documentation yet. (I think
> it was David Fanning who pointed this out originally,
> which is why his above response puzzles me a little...
> seems a little long-winded?).

Whoops! Indeed. This is a case if I don't write it
down and make a tip out of it for my web page I
promptly forget it. :-(

Cheers,

David

P.S. "Old-fashioned" and now "long-winded" in
the same week. I think I'm going to start looking
for other work. Ten plus years with IDL is enough!

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: change widget slider maximum dynamically? [message #17589 is a reply to message #17588] Tue, 02 November 1999 00:00 Go to previous message
Craig Hamilton is currently offline  Craig Hamilton
Messages: 28
Registered: December 1996
Junior Member
One way I have dealt with this problem is to just not display
the slider min and max values and use text widgets to display
the min/max values. I just set the slider to a min of 0 and max
of 100 and read off the percentage that I'm interested in.
That way, the slider widget doesn't need to
be changed. You just have to keep track of the data min/max
separately and calculate the percentage into the data based
on the slider setting.

Craig

--
-Craig A. Hamilton,PhD cah@medeng.wfubmc.edu
-Wake Forest Univ. School of Medicine
-Dept. of Med. Engr. / MRI Center
-Medical Center Blvd.
-Winston-Salem, NC 27157-1022
-(336)716-2819 [FAX: 2870] [Secr: 6890]


David Fanning wrote:
>
> Rob Dimeo (robert.dimeo@nist.gov) writes:
>
>> No doubt someone has probably figured this one out some time ago.
>> However can anyone help me with using the widget slider control? In
>> particular I would like to be able to set the maximum value of the
>> widget slider dynamically (i.e. after the slider has been realized). I
>> would like to set the maximum value of the slider at the conclusion of
>> reading in a data set. Since a new data set may contain a different
>> number of "groups" then the first one then it would be ideal to simply
>> update the maximum in the slider.
>
> I was just looking at a piece of code I have that does
> exactly this. I resorted to destroying the old slider
> and recreating a new one with a new maximum value.
> I'm not a big fan of destroying any widget except the
> top-level base (I guess because I got hurt so bad
> when widgets first came out years ago), but this
> worked wonderfully well in my Windows application
> and I think it is reasonably safe to do now on
> most platforms.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
Re: change widget slider maximum dynamically? [message #17591 is a reply to message #17588] Tue, 02 November 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Rob Dimeo wrote:

> Hi,
>
> No doubt someone has probably figured this one out some time ago.
> However can anyone help me with using the widget slider control? In
> particular I would like to be able to set the maximum value of the
> widget slider dynamically (i.e. after the slider has been realized). I
> would like to set the maximum value of the slider at the conclusion of
> reading in a data set. Since a new data set may contain a different
> number of "groups" then the first one then it would be ideal to simply
> update the maximum in the slider.
>
> Thanks in advance!
>
> Rob

Look at widget_control:

R.Bauer



SET_SLIDER_MAX

This keyword applies to widgets created with the WIDGET_SLIDER function.

Set this keyword to a new maximum value for the specified slider widget.

Note This keyword does not apply to floating-point sliders created with the
CW_FSLIDER function.

SET_SLIDER_MIN

This keyword applies to widgets created with the WIDGET_SLIDER function.

Set this keyword to a new minimum value for the specified slider widget.

Note This keyword does not apply to floating-point sliders created with the
CW_FSLIDER function.
Re: change widget slider maximum dynamically? [message #17593 is a reply to message #17588] Tue, 02 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Rob Dimeo (robert.dimeo@nist.gov) writes:

> No doubt someone has probably figured this one out some time ago.
> However can anyone help me with using the widget slider control? In
> particular I would like to be able to set the maximum value of the
> widget slider dynamically (i.e. after the slider has been realized). I
> would like to set the maximum value of the slider at the conclusion of
> reading in a data set. Since a new data set may contain a different
> number of "groups" then the first one then it would be ideal to simply
> update the maximum in the slider.

I was just looking at a piece of code I have that does
exactly this. I resorted to destroying the old slider
and recreating a new one with a new maximum value.
I'm not a big fan of destroying any widget except the
top-level base (I guess because I got hurt so bad
when widgets first came out years ago), but this
worked wonderfully well in my Windows application
and I think it is reasonably safe to do now on
most platforms.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: point_lun question
Next Topic: high priority interupt event

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:04:24 PDT 2025

Total time taken to generate the page: 0.00505 seconds