Re: how do I do *that*? [message #13535] |
Thu, 19 November 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Peter Clinch (p.j.clinch@dundee.ac.uk) writes:
> David, you're a star! As well as this one, your various recent posts on
> 24 bit colour have dug me out of a few holes too, now I actually *have*
> 24 bit colour...
Ah, Peter, you are too kind.
Do you have one of my books? You could probably get a
very sweet deal this morning. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
|
Re: how do I do *that*? [message #13539 is a reply to message #13535] |
Thu, 19 November 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Peter Clinch (p.j.clinch@dundee.ac.uk) is coming over
from the dark side when he writes:
> I'm just converting an old widget program from PV~Wave to IDL: it's
> pretty much a re-write with rather better functionality, but for various
> reasons it needs to be done by, oh, yesterday, so some help would be
> much appreciated!
>
> The program is to define ROIs in sequential slices of a stack MRI brain
> images, so the basis is a CW_ZOOM to allow the user to identify the bit
> they're interested in and then zoom in to make the definition easier.
> Now the bit I can't work out, which is getting the widget ID of the draw
> window that CW_ZOOM's using for the display, so I can pass that into
> CW_DEFROI.
>
> Any suggestions as to how this is done, or alternative strategies to get
> the ROI set on a CW_ZOOM widget window?
I think the easiest thing to do is simply to modify the
CW_ZOOM event structure to include the ID of the draw
widget as well as all of the other information that is
returned. You will have to exit IDL after you make this
change because this is a named structure.
If you prefer not to modify the CW_ZOOM code for some
reason, then you can simply traverse the widget hierarchy
until you find the draw widget. As it happens, it is the
first child of the first child of the compound widget's
top-level base.
So, assuming that you get the CW_ZOOOM event in your event
handler, you can find the draw widget ID like this:
firstChild = Widget_Info(event.id, /Child)
drawID = Widget_Info(firstChild, /Child)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
|
|
|