[comp.windows.x] New colormaps

alien@monkey.ecn.purdue.edu (Yin Chan) (03/18/91)

Hi,

   Two weeks ago I posted a question about installing a new colormap.
Thanks for the help I got.  The problem is partly solved but I am still
puzzled.  Now I can change the colormap to the one I create only under
the "dxwm" we got along with a DEC5000.  But my program does not work
under "twm".  Could anyone come to help?  I am including the part of my
prog for sake of investigation.


	Thanks a lot!

Yin

/*******		

    Colormap  		def_colormap, MyColorMaps[MAXCMAPS];

   /*	set colormap for drawing  */
   XtSetArg (args[0], XtNcolormap, cmap);
   XtSetValues(widget, args, 1);

   /*	Install the new colormap */
   XInstallColormap (display, cmap);

   window = XtWindow(widget);
   XSetWindowColormap (display, window, cmap); 
   XGetWindowAttributes(display, window, &winAttributes);
   winAttributes.colormap = cmap;
   XChangeWindowAttributes (display, window, CWColormap, &winAttributes);
   gc = XCreateGC(display, window, None, (XGCValues *)NULL);
   XtSetWMColormapWindows(widget, &widget, 1);

*********/