Re: iTools and WSET [message #46964] |
Fri, 13 January 2006 10:39 |
David Alexander
Messages: 26 Registered: August 2005
|
Junior Member |
|
|
James,
Got it.
I think you have to call WSET before calling TV. As long as there are
active draw windows, the the current window will be set to one of them.
It's only when you close all the draw windows that !D.WINDOW gets set
back to -1. So if you've got some direct graphics windows in your
panel, but no other open windows, the current window will always be set
to one of them.
I suppose the only other alternative is to use object graphics in the
draw widgets in your panel, and leave the management of the direct
graphics windows to the user at the command line...
Dave
|
|
|
Re: iTools and WSET [message #46966 is a reply to message #46964] |
Fri, 13 January 2006 10:06  |
James Everton
Messages: 19 Registered: November 2005
|
Junior Member |
|
|
David,
I may have been a little unclear in what I wanted to happen.
Surprisingly, I had already done what you said in my notify_realize
routine to get my panel set up, which is kind of surprising to me. :o)
What I meant to say was that I wanted to be able to go back to the IDL
prompt while my iTool is open and be able to use TV there and have IDL
automatically create a "new" window, as opposed to writing into my
iTool. I don't want the user to have to write WSET, 0 in order to get a
new window available to them.
I tried a few things and the only one I've gotten working so far is to
call WSET, 0 followed by WDELETE inside my panel event handler. This
opens up a blank IDL graphics window then closes it immediately, and
ultimately works. However, I am only able to do this if the user
chooses to click the button I made in my panel.
I tried putting WSET,0 followed by WDELETE in my panel's notify_realize
routine after I have loaded in all my thumbnail images, but for some
reason the creation of the iTool seems to mess that part up, so I'm
forced to resort to the panel button I made.
Hopefully I've cleared that up so you know what it is I'm trying to do.
Thanks again for your help.
- James
|
|
|
Re: iTools and WSET [message #46967 is a reply to message #46966] |
Fri, 13 January 2006 10:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Alexander writes:
> Not hard at all. In fact, I've used direct graphics in my iTools
> applications.
Yeah, and I've pounded a few nails with my wrench, too. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: iTools and WSET [message #46969 is a reply to message #46967] |
Fri, 13 January 2006 09:47  |
David Alexander
Messages: 26 Registered: August 2005
|
Junior Member |
|
|
David,
> P.S. Let's just say that I'm pretty sure the guys
> who are good with iTools have a pretty hard time
> getting their heads around the the idea of
> direct graphics in the same application.
Not hard at all. In fact, I've used direct graphics in my iTools
applications.
Dave
|
|
|
Re: iTools and WSET [message #46970 is a reply to message #46969] |
Fri, 13 January 2006 09:46  |
David Alexander
Messages: 26 Registered: August 2005
|
Junior Member |
|
|
James,
You need to make the window ids of the draw windows accessible to the
command line environment so you can call WSET with the right ids. The
ids of the draw windows aren't set until the panel is realized, so you
could put some code in your panel's notify_realize routine to get the
ids, and save them somewhere where you can access them from the command
line later. For example, in your notify_realize routine you could get
the ids, and save them as a property in the tool object.
I would save the draw widget ids, as well as a reference to the tool
object, in a state structure that you add as the user value to your
panel widget. Then, in the notify_realize routine, retrieve the state
structure and get the widget ids and the tool object. Call
WIDGET_CONTROL with the GET_VALUE keyword on the draw widgets to get
the associated window ids.
If you implement a new property in your custom tool class that will
hold the window ids, then call the tool's SetProperty method while in
the notify_realize routine to set this property with the window id
values.
Now, from the command line, after the tool has started, you can get the
tool object (using itGetCurrent as usual), and call GetProperty on the
tool to get the list of window ids for the thumbnail windows. Then call
WSET with the id of the window you're interested in using.
Dave
|
|
|
Re: iTools and WSET [message #46979 is a reply to message #46970] |
Thu, 12 January 2006 16:49  |
James Everton
Messages: 19 Registered: November 2005
|
Junior Member |
|
|
Oh, I just realized that I sounded a little bitter in my last response.
Sorry about that. What I meant to say was that I am very thankful for
the help you gave me previously to get me this far. :o)
|
|
|
Re: iTools and WSET [message #46980 is a reply to message #46979] |
Thu, 12 January 2006 16:24  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Everton writes:
> Ha ha. Thanks for your help on that, David.
Well, I realize I wasn't very helpful. I am ... uh,
busy with other things.
But, I am looking forward to David's response with
more than my usual interest. :-)
Cheers,
David
P.S. Let's just say that I'm pretty sure the guys
who are good with iTools have a pretty hard time
getting their heads around the the idea of
direct graphics in the same application.
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|
Re: iTools and WSET [message #46983 is a reply to message #46981] |
Thu, 12 January 2006 15:08  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Everton writes:
> I've created an iTool that's inherited from iImage except it has an
> extra panel on the right side that has a list of thumbnail images. When
> I initialize the panel, I use WSET to move from draw widget to draw
> widget and then use TV to output the images to the draw widget. That
> all seems to work fine.
Oh, oh. I think David Alexander's hair just turned white! :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|