Re: common variables between widgets [message #32698] |
Tue, 29 October 2002 15:40 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Holger Boehm (boehmholger@hotmail.com) writes:
> I�m a beginner to IDL with some knowledge of VB and C++.
> Presently, I try to catch on to widget-programming and now encounter
> some problems regarding the scope of variables.
>
> My problem:
> I want to load an image file by pushing a button and then manipulate
> the image data using a slider. How can I allow the slider-procedure to
> "see" the image data as loaded in the button-procedure?
>
> Looking forward to your tips,
The best tip is to get a book. Either mine or Liam's
will get you started in the right direction. The
only difference between the two is that Liam felt constrained
to keep his reputation unsullied as he was writing. I
didn't have to bother since I didn't have a job at the
time. :-)
Then, learn to love "info" structures. You can find them
in any widget program on my web page, but you might start
with something like XStretch, if you want to see how to
do something with an image:
http://www.dfanning.com/programs/xstretch.pro
Learn how to store them in the user value of the top-level
base, and how to retrieve them from there (and put them back)
in your event handlers. Put everything you need to run your
program in the info structure.
If you do persist in using Common blocks, be sure you also
become familiar with XREGISTERED. You will need it to protect
your programs. :-)
Good luck with this.
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|