[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ?Must run program twice for color to work?



Ben Tupper wrote:
> 
> Liam Gumley wrote:
> 
> > It's hard to say exactly what the problem is without seeing any
> > code.
> > However the following two items are crucial:
> >
> > (1) At startup, before you issue any other commands, type
> > device, true=24, decomposed=0, retain=2
> > window, /free, /pixmap
> > wdelete, !d.window
> 
> Can you explain why it is important to create then destroy a window?

On Unix systems, the IDL visual mode (e.g. PseudoColor vs. TrueColor) is
not 'locked in' until you create a graphics window. I prefer to use the
DEVICE, TRUE=24 command at IDL startup, so that I know TrueColor mode is
locked in for the rest of the session (you can't change it once a
graphics window has been opened). On 24-bit SGI consoles, if you don't
use this command you risk getting into DirectColor mode, where all hope
is lost.

The DECOMPOSED and RETAIN keywords can be reset anytime, but it's more
convenient to set them at the beginning of the IDL session, rather than
relying any assumed default IDL behavior. You should also be sure that
any applications you write don't assume a particular value for these
keywords. If your application requires DECOMPOSED=0, then make sure you
set it explicitly.

Cheers,
Liam.

-- 
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley