Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!uflorida!ukma!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!dartvax!maxlin!quinn From: quinn@maxlin.dartmouth.edu (Jerry Quinn) Newsgroups: comp.windows.x Subject: HELP!!! Summary: X timing troubles? Message-ID: <10862@dartvax.Dartmouth.EDU> Date: 11 Nov 88 17:51:22 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: quinn@sunapee (Jerry Quinn) Organization: Dartmouth College Lines: 48 I have been trying to get my own colormaps to work with X11R3. This is the section of code that is doing this : Display *dpy; /* X server connection */ Window win; /* Window ID */ GC gc; /* GC to draw with */ Colormap colors; XColor color; /************** Colormap Section ******************************/ colors = XCreateColormap(dpy,win,vs,AllocAll); for (i=0; i < 256; i++) { color.pixel = i; color.red = color.green = color.blue = i<<8; color.flags = (DoRed | DoGreen | DoBlue); XStoreColor(dpy,colors,&color); } XInstallColormap(dpy,colors); gcv.foreground = 128; gcv.background = 200; gc = XCreateGC(dpy, win, (GCForeground | GCBackground), &gcv); XMapWindow(dpy,win); /******** draw a colorbar ***********/ for (ij=0; ij < 256; ij++) { gcv.foreground = ij; XChangeGC(dpy, gc, (GCForeground), &gcv); XFillRectangle(dpy,win,gc,83+ij*2,43,2,10); } XFlush(dpy); This creates a grayscale map on my color SUN-3. The last part puts up a colorbar of the whole colormap. Or rather it should. This is the problem: If I run the program, it puts up my window, the associated widgets and such, but doesn't draw the colorbar. If I step through a few lines at a time in the debugger, the colorbar gets drawn. I have no ideas on how to fix this. (The whole program window consists of widgets and one normal drawing window). please reply either to this group or e-mail me. thanks in advance, jerry quinn quinn@sunapee.dartmouth.edu