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

Home » Public Forums » archive » Re: Need Workaroud for UNIX Color Bug
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: Need Workaroud for UNIX Color Bug [message #74864] Mon, 07 February 2011 00:12 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Am 05.02.2011 16:36, schrieb David Fanning:
> David Fanning writes:
>
>> I spent at least an hour an a half trying all
>> kinds of solutions at 3AM and couldn't come up
>> with anything I can actually do *inside* my
>> program to fix it.
>
> I should have taken a shower. :-(
>
> If I just save !P.Color and !P.Background
> before I create the draw widget, and restore
> them after, I can get cgWindow to work again!
> Hurrah!
>
> I'll write a note for the web page.
>
> Cheers,
>
> David
>
>

Our setup does this trick too

IDL> test
Before MakeWidget: 0 16777215
After MakeWidget: 0 16777215

cheers
Reimar
Re: Need Workaroud for UNIX Color Bug [message #74877 is a reply to message #74864] Sat, 05 February 2011 07:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I spent at least an hour an a half trying all
> kinds of solutions at 3AM and couldn't come up
> with anything I can actually do *inside* my
> program to fix it.

I should have taken a shower. :-(

If I just save !P.Color and !P.Background
before I create the draw widget, and restore
them after, I can get cgWindow to work again!
Hurrah!

I'll write a note for the web page.

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: Need Workaroud for UNIX Color Bug [message #74879 is a reply to message #74877] Sat, 05 February 2011 06:16 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
C.E. Ordonez writes:

> I'm running IDL 8.0.1 (linux x86_64 m64) in openSUSE 11.3.
>
> I have the following two lines in my IDL startup file:
>
> window, /FREE, /PIXMAP
> if !D.WINDOW ge 0 then wdelete, !D.WINDOW
>
> Running your test program, the plot comes up fine the first time.

Yes, this is the first thing I thought to try, too.
But the problem is, running this code in *either*
TEST or MAKEWIDGET (or both!) doesn't solve the
problem. The window needs to be created outside
the program I want to run!

This is a very strange and persistent bug. :-(

I spent at least an hour an a half trying all
kinds of solutions at 3AM and couldn't come up
with anything I can actually do *inside* my
program to fix 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.")
Re: Need Workaroud for UNIX Color Bug [message #74880 is a reply to message #74879] Sat, 05 February 2011 05:07 Go to previous messageGo to next message
C.E. Ordonez is currently offline  C.E. Ordonez
Messages: 10
Registered: May 2004
Junior Member
On 02/05/2011 03:49 AM, David Fanning wrote:
> Folks,
>
> I have run into the following problem on UNIX machines,
> including IDL 7 on Mac and IDL 8 on an UBuntu LINUX
> machine. It seems to be a long standing problem that
> is giving me grief.
>
> Here is the situation. If the following program is
> run at the very start of a *NEW* IDL session, the
> window will draw a white plot on a white background.
> Look carefully, because this is *very* hard to see. :-)
>
> Subsequently, the program will run fine. Here is the
> simple program:
>

Hi David,

I'm running IDL 8.0.1 (linux x86_64 m64) in openSUSE 11.3.

I have the following two lines in my IDL startup file:

window, /FREE, /PIXMAP
if !D.WINDOW ge 0 then wdelete, !D.WINDOW

Running your test program, the plot comes up fine the first time.

-Caesar
Re: Need Workaroud for UNIX Color Bug [message #74956 is a reply to message #74879] Mon, 07 February 2011 09:34 Go to previous message
Nigel Wade is currently offline  Nigel Wade
Messages: 286
Registered: March 1998
Senior Member
On 05/02/11 14:16, David Fanning wrote:
> C.E. Ordonez writes:
>
>> I'm running IDL 8.0.1 (linux x86_64 m64) in openSUSE 11.3.
>>
>> I have the following two lines in my IDL startup file:
>>
>> window, /FREE, /PIXMAP
>> if !D.WINDOW ge 0 then wdelete, !D.WINDOW
>>
>> Running your test program, the plot comes up fine the first time.
>
> Yes, this is the first thing I thought to try, too.
> But the problem is, running this code in *either*
> TEST or MAKEWIDGET (or both!) doesn't solve the
> problem. The window needs to be created outside
> the program I want to run!

It works here. It won't work in makewidget, it has to be done before you
set your values for the foreground/background colours.

The problem is the way IDL initializes colour tables, and the way it
handles X. Until IDL actually interrogates the X window manager for
visuals it doesn't know anything about what X visuals are available.
When IDL does eventually get around to initializing the display it has a
tendency to overwrite values which you have already set (like the
background and foreground colours) for those which it finds in the
selected visual. At least I think that's what it's doing, it's all done
very much behind closed doors.

The trick is to get IDL to initialize X before you set the colours. The
window command should initialize X, so when you actually create your own
window and plot to it the values you set for the colours won't get
overwritten.

Where did you place Caesar's example code?

This code works for me (I'm using IDL 7.1):

pro test2
device, decomposed=1
window, /FREE, /PIXMAP
if !D.WINDOW ge 0 then wdelete, !D.WINDOW
!p.background=16777215L
!p.color=0L
print, 'Before plot: ', !p.color, !p.background
plot, findgen(11)
print, 'After plot: ', !p.color, !p.background
end


Comment out lines 2 and 3 and you get your all white plot.

--
Nigel Wade
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Converting map altitude coordinates (Z)
Next Topic: Re: how to put bounding box over detected regions?

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

Current Time: Wed Oct 08 15:49:03 PDT 2025

Total time taken to generate the page: 0.00459 seconds