|
|
| Re: Widget Help [message #31763 is a reply to message #6062] |
Wed, 14 August 2002 11:03  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Karthikayan B. (lovedale27@hotmail.com) writes:
> I just started learning about widgets and GUI programmes in IDL.
> After having looked at the examples in the IDL directory, I have a
> vague idea about widgets.
I'll bet you do, *especially* if you looked at the examples
in the IDL directory. :-)
> I wonder if anyone here can help me with a
> skleton code for me to look at and continue from there on. Assume that
> this is the reqirement:
>
> a) get a numerical value, call it A
> b) based on A, generate a set of possible values for another variable
> 'b'. Say b extends from 0 to 2*a. I need to show a drop-list or
> something like that with these values and the user picks a value for b
> (the values he picks are restricted based on what he picked for 'a')
> c) write a and b to an ASCII file
>
> I can, of course, do these steps without a GUI.
It sounds to me you don't so much want a Graphical User
Interface, as you want an alternative method for gathering
user input. Instead of using the keyboard, for example,
you would like to have the user input information into
some kind of widget dialog.
I call this kind of thing a Modal Dialog Widget. You can
find several examples on my web page. The simplest is a
dialog that allows you to enter some text and get it back.
http://www.dfanning.com/programs/textbox.pro
You could easily use this to get an integer value:
returnedText = TextBox(Value='Variable A: ')
intValue = Fix(returnedText)
You would have to build something similar, with a
droplist widget instead of a text widget, to get
the values for B, etc.
If you want to see a more complicated Modal Dialog
Widget, have a look at PickColorName or SelectImage:
http://www.dfanning.com/programs/pickcolorname.pro
http://www.dfanning.com/programs/selectimage.pro
They all work on the same principle.
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
|
|
|
|