Re: Determining window types [message #33323] |
Thu, 19 December 2002 08:57  |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
"James Tappin" <sjt@star.sr.bham.ac.uk> wrote in message
news:atsr1t$9hu$1@sun3.bham.ac.uk...
[stuf deleted]
> The particular application I had in mind was a case where I wanted to run
an
> interactive locator tool within a package that can either be operated from
> a CLI in which case it uses regular graphics windows, or from a GUI in
> which case it uses a draw_widget and since they get positions in different
> ways this is clearly tricky.
Any chance you could modify the application so it *always* uses draw
widgets?
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|
|
Re: Determining window types [message #33327 is a reply to message #33324] |
Thu, 19 December 2002 06:29   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
James Tappin (sjt@star.sr.bham.ac.uk) writes:
> Is there any way of determining whether a graphics window is:
> 1) A draw widget
> 2) A pixmap or
> 3) A regular window?
>
> While "device, window_state=wstat" is useful to prevent trying to do illegal
> operations on on-existent windows, there are sufficient differences between
> the 3 types of window it would be very useful to be able to distinguish
> from within a program.
I don't think there is any way to determine between
windows of different types, but I have to admit I
don't really see the need for this capability.
Graphics programs are typically either written in such
a way that they are completely ignorant of where they
are "going" (I.e., they go into PostScript output as
easily as they go into the current graphics window)
or they are written in such as way that you know
*exactly* where graphic output is going (ie., a
widget program).
I think only programs that *hope* they know what
the hell they are doing would benefit from this
feature. :-)
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
|
|
|
Re: Determining window types [message #33405 is a reply to message #33324] |
Fri, 20 December 2002 09:52  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
I think Liam's suggestion is the way to go. If you had multiple DG
windows and worked in CLI you have no other means of changing the target
window but WSET. And if you do use WSET then you obviously know the
target window ID.
The only way to allow interactive window selection, AFAIK, is to use
widgets. Here's one simple template that may help:
http://www.ainaco.com/idl/idl_library/smart_w.pro
Cheers,
Pavel
James Tappin wrote:
>
> David Fanning wrote:
>
>> James Tappin (sjt@star.sr.bham.ac.uk) writes:
>>
>>> Is there any way of determining whether a graphics window is:
>>> 1) A draw widget
>>> 2) A pixmap or
>>> 3) A regular window?
|
|
|