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

Home » Public Forums » archive » Re: passing values to cw_fslider
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: passing values to cw_fslider [message #58866] Thu, 21 February 2008 12:55
mmiller3 is currently offline  mmiller3
Messages: 81
Registered: January 2002
Member
>>>> > "Mark" == Mark <astroboy2k@gmail.com> writes:

> Hello. I'm trying to write a program in which changes in
> the quantity associated with one widget are reflected in
> the values of other widgets, and I am at a loss to do
> this. In fact, I'm not sure it even can be done.

> In the example below, I have slider widgets for mass,
> volume, and density. If I change the volume slider, the
> mass is held constant and a new value for the density is
> calculated. Etc.

In your example, the get and set_uvalue stuff is in the main
routine, not your event handlers. If you identify each widget
with a uname, you can use widget_info(event.top,find_by_uname='widget uname')
to find the appropriate widget, then get their values and update
as needed in your event handlers.

For example, if you define your widgets like this:

dens = cw_fslider(slide_dens,value=5.,min=0.1,max=10.,title='DENSIT Y: gm/cc', uname='density')
vol = cw_fslider(slide_vol,value=8.,min=0.1,max=10.,title='volume: cm-cubed', uname='volume')
mass = cw_fslider(slide_mass,value=40.,min=0.1,max=100.,title='mass : grams', uname='mass')

then you could rewrite pro_1 to include

widget_control, widget_info(event.top,find_by_uname='volume'), set_value=(*pinfo).mass/density

and so on for pro_2 and pro_3.

Mike
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: question: IDL for incorporating text files in hyperspectral band math
Next Topic: Generate lat/lon coords from already projected data

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

Current Time: Wed Oct 08 20:06:34 PDT 2025

Total time taken to generate the page: 0.01296 seconds