Re: Parent Child relationship in IDL [message #39812] |
Wed, 23 June 2004 05:05  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
IDLmastertobe writes:
> I just implemented a .pro program that displays an image in its draw
> window. The program is able to draw a box on top of this image where the
> area of the image enclosed by the box will be zoomed in on another window.
> Next, the program takes the image enclosed by the box and passes it on as
> a parameter to itself using the 'CALL_PROCEDURE' method.
>
> Essentially, I now have two of the same .pro programs running, where the
> first window has the original image, and the second window has the zoomed
> image.
>
> My problem is that I would like to redraw the box on the first window, and
> output the zoomed image to that same second window. However, the program
> displays the image enclosed by the box on a third window. How can I
> construct a relationship between the parent and child window?
You don't need a relationship. You just need to know what
window you are drawing into, an indisputable requirement
in *every* widget program that uses draw widgets!
Here is the rule: Don't draw graphics unless you know
*exactly* where they are going to show up. :-)
Have a look at ZIMAGE. It does, uh, more or less, what
you are trying to do:
http://www.dfanning.com/programs/zimage.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Parent Child relationship in IDL [message #39951 is a reply to message #39812] |
Wed, 23 June 2004 18:40  |
IDLmastertobe
Messages: 54 Registered: June 2004
|
Member |
|
|
David,
I took a look at your program and saw how you are able to zoom on a
section of the original image and output it to a new window.
The program that I am working on does just that, but I want to be able to
zoom into consecutive images. In your program, what would you do so that
you can recursively zoom in on the new window, such that the new window
can do exactly what the original window does.
Right now, the program I wrote can open a image and zoom on the image,
resulting in the opening of another window with a new image. Then, I can
zoom in again on the new image resulting in the opening of another window.
The program can keep recursively calling itself so as to have multiple
programs running and each window has the same capabilities of the original
window.
Suppose I have three windows open (so 3 of the same .pro programs
running), each a zoomed image from the previous window. My question is
how can I go back to the first window (the first .pro progam) and rezoom
so that it redraws on the second window (so the second .pro programs)?
Please help...
Also, keep in mind, after zoom onto another window, each child window can
do exactly what the original window does. So each child window has the
same buttons as the first window (ex: file, open..., exit, plot, etc...)
|
|
|