Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!pattersw From: pattersw@cs.rpi.edu (William Patterson) Newsgroups: comp.windows.x Subject: twm intercepting XDraw...? Message-ID: Date: 10 Jul 90 00:31:15 GMT Distribution: na Organization: RPI Computer Science Dept. Lines: 90 twm seems to be intercepting XDraw... calls on my sparc. I've created a single window, created a GC for it, and called XDrawRectangle. If the window attribute override_redirect is set to true, the window appears and the rectangle is drawn. If override_redirect is set to false, twm draws an outline of the window, waits for me to place it, and then maps the window. The rectangle, however, never appears. Anybody know why this is happening? ------------------- relevant code --------------------------- Code to create window: XSetWindowAttributes theWindowAttributes; XSizeHints theSizeHints; unsigned long theWindowMask; Window theNewWindow; XWMHints theWMHints; theWindowAttributes.border_pixel = theBlackPixel; theWindowAttributes.background_pixel = theWhitePixel; theWindowAttributes.override_redirect = True; theWindowMask = CWBackPixel | CWBorderPixel | CWOverrideRedirect; theNewWindow = XCreateWindow(display, RootWindow(display, screen), x, y, width, height, BORDER_WIDTH, depth, InputOutput, CopyFromParent, theWindowMask, &theWindowAttributes); <...set size hints parameters...> XSetNormalHints ( display, theNewWindow, &theSizeHints); Code to draw rectangle: theGC = createGC( window ); XDrawRectangle( display, window, theGC, 5, 5, 50, 50 ); XFlush(display); Code to create GC: theGCValues.foreground = theBlackPixel; theGCValues.background = theWhitePixel; theGCValues.line_width = 2; GCmask = GCForeground | GCBackground | GCLineWidth; theGC = XCreateGC( display, window, GCmask, &theGCValues ); MAIN: window = openWindow (0,0, 200, 200); XMapWindow( display, window); XFlush( display); draw (window); XFlush(display); XDestroyWindow( display, window); ------------------------ END -------------------------- Email, please. I'll sumarize if other people are having the same problem (or soln isn`t obvious). Bill Patterson pattersw@turing.cs.rpi.edu -- ----------------------------------- Bill Patterson pattersw@turing.cs.rpi.edu Computer Science Department Rensselaer Polytechnic Institute Troy, NY. -----------------------------------