Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!mintaka!bloom-beacon!dont-send-mail-to-path-lines From: bmc@bmw.mayo.EDU Newsgroups: comp.windows.x Subject: Allocating color cells on a DEC5000pgx Message-ID: <9102011532.AA28146@bmw.mayo.EDU> Date: 1 Feb 91 15:32:41 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 44 Given the following workstation: DEC5000pgx Ultrix 4.1 & DECwindows The following code failes (i.e. xncolors becomes = to 0): cmap = XCreateColormap (display, window, visual, AllocNone); xncolors = (unsigned int)visual->map_entries; while (!XAllocColorCells (display, cmap, True, xplane_masks, 8, xpixels, xncolors)) { fprintf (stderr,"failed to allocate %d colorcells trying %d\n",xncolors, xncolors-1); xncolors--; } xmaxcolor = xncolors; I am trying to find the maximum number of color cells I can get for my application. According to xdpyinfo, if I use a PseudoColor visual I should be able to get a maximum of 256 color cells and 8 planes. I request a visual via: vtemplate.class = PseudoColor; vtemplate.depth = G_bits; vtemplate.screen = DefaultScreen(display); vlist = XGetVisualInfo (display, VisualScreenMask | VisualClassMask | VisualDepthMask, &vtemplate, &visuals_matched); and set my window's visual to vlist[0] if the call is successful. Can any kind soul point out what I am doing wrong? I need to get as many colorcells as possible, yet still be kind to other applications that may be running. Many thanks in advance for any and all aid. --Bruce ----------------------------------------------------------------- Bruce M. Cameron bmc@mayo.edu Biotechnology Computing Resource (507) 284-3288 Medical Sciences 1-14 Mayo Foundation Rochester, MN 55960 WD9CKW -----------------------------------------------------------------