|
Re: al_legend producing an unwanted circle [message #79093 is a reply to message #79086] |
Thu, 26 January 2012 10:45  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian Wolven writes:
> Generally when the observer influences the outcome it means that quantum mechanical phenomena are involved. ;)
Yes, I think that is what is going on here! ;-)
OK, I am not *exactly* sure what is going on here, but
here is what I know about the problem.
The problem occurs on line 485 of AL_Legend, the
second of two calls to cgText that are close to one
another. If I put a breakpoint on that line and step
over it, the circle appears. If I put a breakpoint
on that line and step into cgText, the circle never
appears. (One of the mysteries, I suppose!)
In any case, the "problem" appears to be in cgText
on or about line 220 in which I am trying to return
the normalized width of the text. I know this because
if I take all those lines out and just return a fake
width, the circle never appears.
OK, so. Following the directions in the IDL on-line
help, I create a pixmap of the appropriate size
and draw my text there to get the width. This works
perfectly, but somehow causes a circle to appear in the
current graphics window. This happens NO MATTER what
window I make the current graphics window before
I create the pixmap. I conclude from this that it
is some kind of bug in the internal IDL code. I
don't know what else it could be.
To fix this problem, I modified cgText so that I no
longer create a pixmap. Rather, I just add the
cgText command to the cgWindow and draw momentarily
into the cgWindow. No harm is really done here, since
this is not the command that will *actually* appear
in cgWindow, and I am drawing it in the background
color in any case, so it is even less intrusive.
(I had to make a change in cgcmdwindow__define, since
this tickled a typo bug there that was preventing me
from obtaining the window background color.)
So, bottom line, you probably want to update your
Coyote Library, or (at the very least) your
cgText program.
http://www.idlcoyote.com/programs/cgtext.pro
http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: al_legend producing an unwanted circle [message #79099 is a reply to message #79095] |
Thu, 26 January 2012 08:34  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Platten writes:
> I am using al_legend from the NASA astronomy library. I have a cgWindow and a regular IDL graphics window on my screen. When I send a legend to the cgWindow with the /Window switch an unwanted small circle appears on the IDL graphics window. The following code reproduces this on my computer:
>
> cgWindow
> window
> al_Legend, ['Hello'], /Window
>
> I'm running IDL 6.3 on Windows XP.
>
> Does anyone know how I can stop the circle from appearing?
Oh, dear, this is one of those VERY strange ones!
If I run your example, I see the circle. If I set
a breakpoint in AL_LEGEND and step through the code,
no circle is ever produced!
I really don't know what that means at the moment. :-(
I'll keep looking into it.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|