Need Workaroud for UNIX Color Bug [message #74881] |
Sat, 05 February 2011 01:49 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
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:
;******************************************************
PRO MakeWidget
tlb = widget_base()
draw = widget_draw(tlb, xsize=400, ysize=400, retain=1)
widget_control, tlb, /realize
widget_control, draw, get_value=wid
wset, wid
end
PRO Test
device, decomposed=1
!p.background=16777215L
!p.color=0L
print, 'Before MakeWidget: ', !p.color, !p.background
makewidget
plot, findgen(11)
print, 'After MakeWidget: ', !p.color, !p.background
END
;******************************************************
Here is the output on the two machines I mentioned:
IDL> .compile test
IDL> test
Before MakeWidget: 0 16777215
After MakeWidget: 16777215 16777215
If we put calls to Help, /Device before and after
the Widget_Draw command, we find the following difference
in output.
Before Draw Widget Call:
Colormap: Private, 16777216 colors. Translation table: Enabled
After Draw Widget Call:
Colormap: Private, 16777216 colors. Translation table: Bypassed
The output is a white window. If we run the program a second time,
we see the expected black plot in a white window.
We haven't managed to come up with a work-around for this yet.
Do any of you LINUX and Mac users have a suggestion? Thanks!
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.")
|
|
|