Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!cacilj!paul From: paul@cacilj.UUCP (Paul Close) Newsgroups: comp.windows.x Subject: Colormap strangeness Message-ID: <1215@cacilj.UUCP> Date: 8 Sep 89 19:47:43 GMT Reply-To: paul@cacilj.UUCP (Paul Close) Organization: CACI Products Company, La Jolla, CA Lines: 43 I have noticed some strange behavior when trying to modify color programs to use color "responsibly". By that I mean to search the visuals list for a visual class of PseudoColor if I intend to change the colormap entries. The program I'm working with is xgif. The client runs on a sun-4 using MIT's X11R3; the server is a DECstation 3100 running "Ultrix Worksystem V2.0 (Rev. 7)". Once I create a new colormap, and try to use it, the entire screen goes black, except for the picture I'm drawing and the mouse pointer. Unfortunately, I cannot restore the colors to the way they were, not do they revert once the program exits. I also tried running "puzzle -cm -pic mandrill.cm". That changed all the colors on my screen! (At least they weren't all black!) No amount of window selection or anything would change the colors back. What is the problem here? Basically, the program works like this: Determine which visual class to use, and select that visual. Create a colormap: Colormap = XCreateColormap( dpy, RootWindow(dpy,screen), visual, AllocNone ); Use XallocColor to allocate the colors: ... = XAllocColor(dpy,Colormap,&colorMap[i]); Create a window using the selected visual. Map the window. I also tried using XSetWindowColormap, but that seemed to have no effect (the screen still went completely black except for the mouse pointer). I also tried creating a window and then creating a colormap for that window only, but that didn't help either. I hope someone can help--I'm getting tired of rebooting just to get a screen I can see! I'm trying to use the visuals correctly, but it sure is difficult!!! -- Paul Close paul@cacilj.CTS.COM ...!{uunet, ucsd, crash}!cacilj!paul The Obi-wan Kenobi method: "Use the Source, Luke" -Jim Fulton