widgets [message #21375] |
Fri, 18 August 2000 00:00  |
Stuart Colley
Messages: 17 Registered: February 2000
|
Junior Member |
|
|
I've not really used widgets before, any suggestions on how the following
task might be tackled would be appreciated. What I'd like to do is
display an image, stored in an array size x by y, using say tvscl, then
click on part of the image with the mouse and get x, y, and the value of
the array at that location.
Are there any routine(s) suited to this sort of task?
cheers,
Stu
|
|
|
Re: widget [message #22357 is a reply to message #21375] |
Mon, 06 November 2000 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jean Marc Delvit (delvit@onecert.fr) writes:
> How to get a value from a widget box and not from the prompt in IDL?
You need to make what I call a "modal dialog widget".
The main trick (there are several) is to store the information
you want to return somewhere outside the program itself.
This is almost always a pointer location.
The program is written as a function and is written so
that the program stops or blocks at the XMANAGER call
until the widgets are destroyed. At that time the information
collected and stored in the pointer location is retrieved
and returned to the user as the result of the function.
There is an entire chapter of my book devoted to this
subject (if you can find one), or you can look at any
number of programs on my web page. Perhaps a good place
to start is with PICKCOLORNAME:
IDL> color = PickColorName('White')
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: widget [message #22358 is a reply to message #21375] |
Mon, 06 November 2000 00:00  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Write a widget program.
For a more detailed answer, could you try to be more specific about what
you want to do?
Cheers,
Pavel
Jean Marc Delvit wrote:
>
> How to get a value from a widget box and not from the prompt in IDL?
>
> thanks
>
> JMD
|
|
|