Limiting "Flashing" when using IDL at PPPL

When X applications take all the available colors on an X-display, subsequent applications use a "private color map." When focus is then changed to a window with a private color map, everything suddenly "jumps" to the new color map (thus the term "flash"). Other windows become strange looking or unreadable when the new color map is in effect.

If your X-display device supports millions of colors (24-bit color), you have some options. If you have less than 24-bit color, you should set your display to 256 colors. NOTE: Thousands of colors, i.e., 16-bit color, should NOT be used with IDL!

A Manageable Way

If your X display device runs with 256 colors, you have to make some compromises to limit flashing.

Invoking the PPPL routine MK_COLOR *BEFORE* any window creation in an IDL session will, as a default, limit the number of colors in that session to 60 (see for a complete description of this routine). This way, you can have 3-4 IDL sessions going, and not get flashing (on the NSTX Control Room X-terminals this is recommended since they do not support millions of colors).

	IDL> dummy=mk_color('yellow')
This can go in your idl startup file (on Unix the default name is ~/.idl_startup),.

If you just have an IDL window for Help, or for simple x-y plots, you can invoke the following when entering the IDL session:

	IDL> dummy=mk_color(max=12)

The Most Flexible Way

If your X-terminal supports 24-bit color (unlike most at PPPL), or your Mac monitor can run in 24-bit color, you have more options.

To set your Mac, go under the apple...Control_Panels...Monitors, and select millions of colors (thousands of colors, i.e., 16-bit color, should NOT be used with IDL!), and set eXodus (Settings...Server_Settings...Advanced_Settings...Colors) to "same as Monitor." You should then be able to have many color maps without flashing (you may get a benign message about "Unsupported X Windows visual").

Other issues arise when running with 24-bit color, such as having to replot things after changing the color map, etc. Even with millions of colors, I would still recommend:

	IDL> dummy=mk_color(max=256)
For one of the best descriptions on the ins and outs of color use in IDL see

Other possibilities

Note that when you operate with 256 colors, limiting other X-applications, or starting them after IDL, will give you more colors for IDL. E.g., if you run Netscape from a Unix host, you may limit the colors it uses to 64 by making an alias as follows (csh users can put this in their .cshrc file):
        alias  netscape  'netscape -ncols 64 -no-about-splash &'
If your X-windows management is from a Unix host, another way to limit the number of colors IDL defaults to is to have the following lines in your .Xresources file:
	idl.gr_visual: PseudoColor
	idl.colors: 60
If your X-windows management is from a VMS host, these lines would be in the .XDEFAULTS file in your DECW$DEFAULTS directory. E.g., for username JSMITH, this file would be JSMITH$:[DECW$DEFAULTS].XDEFAULTS.

Please mail comments on this page to nstx_sw_dev.

updated: 28-Sep-2000
by: Bill Davis