[comp.windows.x] Help on changing colormaps

harperb@frith.msu.edu (Brett Harper) (08/01/90)

I have been having trouble getting twm to automatically install my
custom colormap.  I have created the colormap with AllocAll and have
assigned all the colors to be a uniform grey ramp.  When I do a
XInstallColormap by hand the colormap flashes in then is replaced by the
default one.  
  The application consists of a toplevel widget returned by XtAppInitialize
holding a single form widget, then that form holds a form which has a box
widget.  It is this box widget where I would like to have the new colormap.
  I have tried using:

1.	XtSetArg(arg[0], XtNcolormap, newcmap)
	XtSetValues(boxwidget, arg, ONE)
2.	XSetWindowColormap(display, XtWindow(boxwidget), newcmap)  
3.	XSetWindowColormap(display, XtWindow(toplevel), newcmap)  
                 - just to see if I could set the colormap of the root widget

4.	attrib.colormap = newcmap; mask = CWColormap
	XChangeWindowAttributes(display, XtWindow(toplevel), mask, &attrib)

None of these seemed to have any effect at all.  When I did these calls all
the widgets were fully realized and displayed.

Is it possible for the window manager to automatically install the new 
colormap for children of the toplevel widget?

Can anyone offer any suggestions for this?

Thanks,
Brett Harper
harperb@frith.egr.msu.edu