[comp.windows.x] Defining Colormaps

huffman@pyrite.som.cwru.edu (John Huffman) (07/24/90)

I am porting program over to X Windows which requires that the colormap
be defined to a specific set of colors.  I was able to accomplish this
with R2 using uwm, but when we upgraded to R3 it was lost.  The colormap
is set if I run it alone without a window manager, but as soon as I use
a wm, the colors pop up and then are replaced by the standard colormap.
It is crucial that I find a way around this, does anyone know how to do this?
An example would be greatly appreciated.

						- John Huffman

mouse@LARRY.MCRCIM.MCGILL.EDU (07/25/90)

> I am porting program over to X Windows which requires that the
> colormap be defined to a specific set of colors.  I was able to
> accomplish this with R2 using uwm, but when we upgraded to R3 it was
> lost.  The colormap is set if I run it alone without a window
> manager, but as soon as I use a wm, the colors pop up and then are
> replaced by the standard colormap.  It is crucial that I find a way
> around this, does anyone know how to do this?

I can't be certain, but your description makes it sound as though the
program is being antisocial and using XInstallColormap itself, which
one is Not Supposed To Do.  (The window manager is correctly noticing
this action and reinstalling the colormap its colormap focus policy
says should be installed.)  (In fact, for it to "work" when there's no
window manager, this must be true.)

To fix it, simply set the window's colormap with XSetWindowColormap (or
some Xt analog thereof; I don't know Xt).  Then let the window manager
do the XInstallColormap when appropriate (what "appropriate" means
depends on the window manager, but typically means when you have the
mouse inside the window).

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu