| Re: PLOT() function...which WINDOW() to plot to...? [message #81449 is a reply to message #81352] |
Wed, 12 September 2012 08:58   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hello,
On 09/12/12 11:07, David Fanning wrote:
> Paul van Delst writes:
>
>> I want to create a window, and have everything plot in that window (be
>> it onscreen or in buffer) regardless of what other graphics windows I
>> have onscreen that I happen to be looking at and click on.
>>
>> I presume there is some magical combination of keywords that will do that?
>
> I think you have to write your loop like this, using
> the SetCurrent method on the window you want to draw
> into:
>
> w.SetCurrent
> index++
> pn = PLOT( $
[snip]
> CURRENT = 1 )
Yeah, I did look at that method (and implemented it as you say) but it
does not solve the basic problem.
If I click on a different window in that infinitesimal amount of time
between the execution of
w.SetCurrent
and
pn = PLOT(...)
the same problem crops up since "w" is no longer the current window.
It's typical that, while plot#n is being written to screen, I'm looking
at plot#(n-1). As soon as I click on that window and give it focus,
everything goes pear-shaped. You're effectively forced to do non-IDL-y
stuff while the program is (slowly) plotting all the FG graphics.
Additionally, it adds the burden of having to put a "w.SetCurrent"
before every single FG call! And that *still* may not be efficacious
depending on how "click-y" one is with existing windows.
It seems to be such a gaping hole in the basic design of these graphics
features that I am sure I am still missing something.
- With DG clicking on windows was a completely separate operation from
setting the current graphics window in a program via WSET.
- With FG, the two operations are intertwined. Clicking on *ANY*
graphics window has exactly the same effect as executing the SetCurrent
method... even if the program is running, and even if the program has
been directed to send all graphics to a buffer rather than onscreen.
Unless there is something in the documentation that I'm missing (or just
misunderstanding), I regard this as a fundamental flaw: there is no way
for a programmer to guarantee the code will run the way it was intended
(i.e. *always* plot to *this* window).
Anyhoo... I guess I'll bring the donuts to the next IDL support group
meeting...
cheers,
paulv
p.s. Argh!
|
|
|
|