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

Re: Prevent color flashing

Patrick L. Nolan (pln@egret1.stanford.edu) writes:

> I'm writing my first IDL widget program.  I have various editions
> of the IDL manuals and also David Fanning's book.  

Forget the manuals if you want to learn widget programming. :-)

> I'm plugging
> along, learning lots of useful things.  There's one annoying thing
> I haven't been able to figure out.  I have a drawing window, and
> I'm using it to display simple monochrome PLOT output.  This is
> running on machine with an 8-bit display, so IDL uses a private color
> table.  The colors flash in the most annoying way when the cursor
> moves in and out of the IDL window.  Is there some way to prevent this?

I suspect there is something going on that you may
not be aware of. There is no way that IDL should
be getting a private color map like this normally.

There are generally three reasons for this:

   1. The number of IDL colors is set in an X Resource file:

         Idl.colors  = 245

      Here IDL wants 245 colors, but there may not be this
      many colors in the shared color map, so IDL obtains
      a private color map.

   2. The number of colors is set in an IDL startup file.

         Window, Colors=256
         WDelete, !D.Window

     Here IDL gets a private color map because there is no
     way to get a shared color map with 256 colors on an
     8-bit computer running a Window system. 

   3. You have NetScape running when you start up IDL.

      NetScape likes a LOT of colors, just like IDL. If
      NetScape is running when IDL starts up, there are 
      no colors left in the shared color map and IDL gets
      a private color map. The solution is to tell NetScape
      to restrict its color consumption (I always forget how,
      but it's simple).

I'd do this. Examine your .XDefaults file (as well as any
system .XDefaults file that may come into play) for anything
resembling Idl.colors and remove it. Then I would make sure
the IDL_STARTUP environment variable wasn't pointing to a
file. Then I'd quit any browser I was running.

Then, I'd start up IDL and open a window:

   IDL> Window

Then send us the results of HELP, /DEVICE and let's see if
we can figure out what is going on. In the meantime, 
read about the Colors keyword to the Window command to
see if setting this parameter (say to -10) will help
your situation. Remember that the number of colors in
your IDL session (and, hence, the type of color map you
get) is determined when the FIRST graphics window is 
opened up. Can't do anything about it after that.


David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155