Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mirsa.inria.Fr!vania From: vania@mirsa.inria.Fr (Vania Jolobof) Newsgroups: comp.windows.x Subject: Colormap full Message-ID: <8901131447.AA07196@inria.inria.fr> Date: 13 Jan 89 14:51:59 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 24 Assume I want to allocate N colors in any number of planes using: XAllocColorCells(myDisplay, myColormap, False, (unsigned long *)NULL, 0, colors, N) and this fails because the colormap is full. I have not found in the documentation what happens then. Are there P colors (P < N) allocated however ? Is P equal to zero ? It seems to me that the client should be able to know in case of failure how many colors have been allocated, and which one. So the client could call: newmap = XCopyColormapAndFree(myDisplay, myColormap) and then allocate the N-P lacking colors in the new colormap. I suggest XAllocColorCells should return in the *pixels_return* parameter the array of pixels effectively allocated with a convention to discover P for the client. There are several ways to achieve that: 1) XAllocColorCells would simply return P. It is not specified today what it returns... 2) the pixels_return array would be NULL terminated. 3) the first element in the pixels_return would be a dummy one and specify P. Vania Joloboff -- vania@mirsa.inria.fr