Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!snorkelwacker.mit.edu!hsdndev!husc3.harvard.edu!husc9!evensen From: evensen@husc9.Harvard.EDU (Erik Evensen) Newsgroups: comp.windows.x Subject: getting standard colormaps Message-ID: <1991May3.160944.824@husc3.harvard.edu> Date: 3 May 91 20:09:42 GMT Sender: evensen@husc9 (Erik Evensen) Organization: Harvard University Science Center Lines: 44 Nntp-Posting-Host: husc9.harvard.edu I'm working on an application where it would be very desireable to use the XA_RGB_BEST_MAP standard colormap. My problem is that I can't seem to get this Colormap. I read and tried out the pertinent sections in both Oliver Jones's book and Scheifler & Gettys's opus but nothing seems to work; i.e., XGetStandardColormap and XGetRGBColormaps return 0 for status. The code I've tried looks something like this: Display *gVfbDisplay; /* display we are attached to */ XStandardColormap gVfbBestRGB; /* the best rgb color map */ if ((gVfbDisplay = XOpenDisplay("")) == NULL) return VFBFAIL; if (XGetStandardColormap(gVfbDisplay, DefaultRootWindow(gVfbDisplay), &gVfbBestRGB, XA_RGB_BEST_MAP) == 0) { printf("failed to get standard colormap...goodbye\n"); exit(-1); } or XStandardColormap *gVfbBestRGB; int nMaps; if (XGetRGBColormaps(gVfbDisplay, DefaultRootWindow(gVfbDisplay), &gVfbBestRGB, &nMaps, XA_RGB_BEST_MAP) == 0) { printf("failed to get standard colormap...goodbye\n"); exit(-1); } I read faq #117 "Why can't my program get a standard colormap?" but this didn't really shed any light on the topic. I'm using X11R4 on various machines (Sparcs and DecStations) using both the console and (primarily) an NCD color X-terminal for display. I'm using the twm window manager. Actually, I guess the only thing I haven't tried is the prescription in appendix D of Scheifler & Gettys. But I think this looks like an awfully messy and unfriendly thing to do -- looks like it should be reserved for window managers... Thanks in advance for any help or pointers... --Erik (evensen@husc9.harvard.edu)