Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!purdue!bu-cs!bloom-beacon!EXPO.LCS.MIT.EDU!jim From: jim@EXPO.LCS.MIT.EDU (Jim Fulton) Newsgroups: comp.windows.x Subject: Re: Allocating 256 color cells Message-ID: <8806161417.AA24808@EXPO.LCS.MIT.EDU> Date: 16 Jun 88 14:17:43 GMT References: <225@raunvis.UUCP> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 31 Deja vu. The default colormap will always have at least colors preallocated for BlackPixel and WhitePixel. In addition, if you are already running any applications (such as a couple of xterms, an xclock, an xload, a window manager, etc.), they will most likely have also allocated some color cells out of the default colormap. So, you won't probably won't be able to allocate more than NCELLS-10 (or so, where 10 is the number of cells that existing applications have grabbed already; your mileage may vary). So, if you want to allocate all of the colormap cells, you'll need to create a new colormap. From last Friday's note: > visual = /* select the proper visual if DefaultVisual isn't right */ > cmap = XCreateColormap (dpy, RootWindow (dpy, scr), visual, All); > > The visual determines what sort of colormap should be allocated. This is > necessary for running on displays that provide more than one type of window > (for example: 24 bit DirectColor and 16 bit PseudoColor, or 8 bit PseudoColor > and 1 bit StaticGray). Useful readings: Xlib manual, Section 3.1, Visual Types Section 5.1, Colormap Functions Section 9.2, Manipulating Standard Colormaps ICCCM This topic clearly needs to be added to the list of Tutorials to be written.... Jim Fulton MIT X Consortium