Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cs!shamash From: shamash@cs.columbia.edu (Ari Shamash) Newsgroups: comp.windows.x Subject: problems with XGetStandardColorMap().. Keywords: color maps xgetstandardcolormap Message-ID: <319@cs.columbia.edu> Date: 28 Aug 89 16:23:24 GMT Reply-To: shamash@cs.columbia.edu (Ari Shamash) Followup-To: comp.windows.x Organization: Columbia University Computer Science Dept Lines: 66 Can somebody please help me with allocating a standard color map? From what I gathered by reading The XLib manual, the following program should work.. I'm using X11 R.3, TWM, and SunOS 4.0 on a Sun 3/60. I've tried this with UWM, too, to no avail. Here is my program: #include #include #include #include main (argc, argv) int argc; char **argv; { Display *display; int screen; Window window; unsigned long foreground; XSizeHints hint; XStandardColormap mystd; GC gc; display = XOpenDisplay(""); screen = DefaultScreen(display); hint.x = 200; hint.y = 300; hint.width = 300; hint.height = 300; hint.flags = PPosition | PSize; window = XCreateSimpleWindow(display, DefaultRootWindow(display), hint.x, hint.y, hint.width, hint.height, 5, WhitePixel(display, screen), BlackPixel(display, screen) ); XSelectInput(display, window, ExposureMask); gc = XCreateGC (display, window, 0, 0); XSetBackground(display, gc, WhitePixel(display, screen)); XSetForeground(display, gc, BlackPixel(display, screen)); XMapRaised(display, window); XFlush(display); if (XGetStandardColormap(display, RootWindow(display, DefaultScreen(display)), &mystd, XA_RGB_DEFAULT_MAP) == 0) { printf("XGetStandardColormap failed.\n"); } XFreeGC(display, gc); XDestroyWindow(display, window); XCloseDisplay(display); exit(0); } Thanks in advance, Ari -- shamash@cs.columbia.edu shamash@gollum.cs.columbia.edu ...!rutgers!columbia!shamash