comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: al_legend producing an unwanted circle
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: al_legend producing an unwanted circle [message #79086] Fri, 27 January 2012 01:27
dplatten is currently offline  dplatten
Messages: 32
Registered: December 2007
Member
Hi David,

Many thanks for your help - the circle is no more.

Regards,

David
Re: al_legend producing an unwanted circle [message #79093 is a reply to message #79086] Thu, 26 January 2012 10:45 Go to previous message
David Fanning is currently offline  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 #79095 is a reply to message #79093] Thu, 26 January 2012 09:39 Go to previous message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
Generally when the observer influences the outcome it means that quantum mechanical phenomena are involved. ;)
Re: al_legend producing an unwanted circle [message #79099 is a reply to message #79095] Thu, 26 January 2012 08:34 Go to previous message
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ENVI
Next Topic: list trouble

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:32:16 PDT 2025

Total time taken to generate the page: 0.00494 seconds