Path: utzoo!censor!geac!jtsv16!uunet!bloom-beacon!POPEYE.NOSC.MIL!glasgow From: glasgow@POPEYE.NOSC.MIL (Michael Glasgow) Newsgroups: comp.windows.x Subject: Colormaps and Visuals Message-ID: <8909191908.AA04405@popeye.nosc.mil.sun.com> Date: 19 Sep 89 19:08:25 GMT Organization: The Internet Lines: 45 I am having a problem with Visuals and Colormaps. I am running on a Navy Desktop Computer, which is a Sun 4/110 and a CG6 color board. I am running the XNews server provided under Sun OS 4.0.3. The problem is that this server defines two visuals: PseudoColor and StaticColor. The default is the StaticColor visual. So, if I AllocNamedColors with the DefaultColormap, I get something close, but not exactly what I wanted. What I want to do is to Alloc Colors from the Colormap whose visual is of type PseudoColor. I am also using the X Toolkit. If I weren't, I suppose that I could simply create a window with the proper visual, and if I accessed the default colormap of this window, I would be able to allocate my colors properly. But in the Toolkit, there is no way to set the visual for a given widget, at least none that I know of. My question is this, how can I show true colors in a widget, when the default visual is of type StaticColor? Also, is the DefaultColormap apply to a window, or does it apply to a visual? I have queried the Visuals and found the proper type, but do no see how I can get the colormap from the Visual Info. Maybe this is not possible, but it seems to me like it should be. One final note. Is there a call that returns the number of un-allocated color cells in a Colormap? Such as: XQueryFreeCells( dpy, cmap, cells, ncells ) Display *dpy; Colormap cmap; XColor cells[ncells]; int *ncells; This call would return the number of free cells in a colormap, as well as a list of all of the free cells. Is there a way to do this now? And if not, will something like this be added in the future? Michael Glasgow glasgow@popeye.nosc.mil