Re: Using Widgets and Procedures [message #80915] |
Mon, 23 July 2012 15:20 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
ecatcom1@gmail.com writes:
> Wasn't sure exactly what to title this. Also I'm no IDL wiz so I probably won't be using the right terminology but bear with me :)
>
> So I have this widget definition module (the procedure that defines everything) that I call from the IDL command line. Its called "autovu". This autovu.pro calls another procedure inside it called autovu_fft when the "Compute AutoCorrelation" button is clicked. The code for this inside of the autovu procedure is w_auto=widget_button(bb, value='Compute AutoCorrelation', frame=2, event_pro='autovu_fft'). Once I am in autovu_fft, this will also output a plot for me, for
which I want to define xmin/xmax/ymin/ymax at the command line (or not, if I want the program to do it automatically). Right now, the program just does it automatically, but I would like to be able to have a choice.
> Is there any way that once I am in autovu_fft I can write some sort of code to ask me in the command line if I want to input ranges or no? I can figure out the rest from there, I just don't know how I would get the range information into my procedure.
> Or, I originally thought I could just call autovu with the ranges at the command line (like autovu, xmin, xmax, ymin, ymax) but I don't know how I would then transfer these values into autovu_fft because of the way autovu_fft is called (by using event_pro). Also, calling autovu in that way seems to make my widgets unusable...I'm on widget pro but I'm thinking maybe you can't mess around with the widget definition module like that?
> Any thoughts are appreciated.
Oh, dear! My thought is to get a good book on widget
programming. The second half of IDL Programming Techniques,
2nd Edition would probably work.
http://www.idlcoyote.com/books/index.php#progtech
I will say this, to get information into a widget program
you DO NOT want to use the IDL command line! You want to
use what is sometimes called a pop-up dialog widget:
http://www.idlcoyote.com/widget_tips/popup.html
Widget programming is not hard, once you get your head around
how widget programs work, but I think you are not quite there
yet. Writing a widget program as an object is even simpler, but
then you have to learn two new things, which is hard for most
people. In any case, you might get a better sense of it from
that book.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|