Path: utzoo!censor!geac!jtsv16!uunet!bloom-beacon!ATHENA.MIT.EDU!swick From: swick@ATHENA.MIT.EDU (Ralph R. Swick) Newsgroups: comp.windows.x Subject: Re: Colormaps and Visuals Message-ID: <8909192040.AA08953@LYRE.MIT.EDU> Date: 19 Sep 89 20:40:46 GMT References: <8909191908.AA04405@popeye.nosc.mil.sun.com> Organization: DEC/MIT Project Athena Lines: 36 > But in the Toolkit, there is no way to set the visual > for a given widget None of the built-in widget classes (e.g. Core) have a Visual resource, you are correct, but that does not prevent other widgets from declaring such a resource and thereby giving the application control. In R3 the default visual type (in XtCreateWindow) is always CopyFromParent. In the revisions just published for the R4 specification, the Shell class defines a Visual resource which is intended to satisfy simple cases such as yours. > My question is this, how can I show true colors in a widget, when > the default visual is of type StaticColor? Until R4 is released, your only choice is to explicitly set the visual type in the realize procedure of your widget. > Also, is the DefaultColormap apply to a window, or does it apply > to a visual? A colormap is associated with a specific visual when it is created, and may only be used with that visual. The DefaultColormap is the colormap of the root window and can only be used with other windows that have the same visual type as the root window. > One final note. Is there a call that returns the number of > un-allocated color cells in a Colormap? Not in Xlib or in Xt. > Is there a way to do > this now? Only by allocating until the server says 'no more'.