Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!bloom-beacon!dont-send-mail-to-path-lines From: thibaud@dabchick.stanford.EDU Newsgroups: comp.windows.x Subject: about GCxor Message-ID: <9104242202.AA05459@dabchick.Stanford.EDU> Date: 24 Apr 91 22:02:44 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 69 my problem is the following : I am trying to set the GC function to GCxor in order to do rubberbanding. Then I am displaying a series of rectangles to check what is the effect of the GXxor. The first rectangle ( R1 ) is displayed with GXcopy ( and appears on the screen ). the second ( R2 ) is drawn with GXxor on white background and doesn't appear. why ? the third ( R3 ) is drawn with GXxor on top of R1. It doesn't erase it. why ? ================================================================================ #include #include main() { Display *display; int screen; Window window; GC gc; XEvent event; XGCValues GCValues; if( (display = XOpenDisplay( NULL )) == NULL ) exit(0); screen = DefaultScreen( display ); window = XCreateSimpleWindow( display, RootWindow( display, screen ), 0,0,200,200, 1, BlackPixel( display, screen ), WhitePixel( display, screen ) ); gc = XCreateGC( display, RootWindow( display, screen ), 0, NULL ); XSetForeground( display, gc, BlackPixel(display,screen) ); XSetBackground( display, gc, WhitePixel(display,screen) ); XSelectInput( display, window, ExposureMask ); XMapWindow( display, window ); XNextEvent( display, &event ); /* to be sur that next drawings will appear */ /* the GC is still GXcopy */ XDrawRectangle( display, window, gc, 10, 10, 30, 30 ); XFlush( display ); sleep(2); /* here I am changing the GC to GCxor */ XGetGCValues( display, gc, GCFunction, &GCValues ); GCValues.function = 0x6; XChangeGC( display, gc, GCFunction, &GCValues ); XGetGCValues( display, gc, GCFunction, &GCValues ); XDrawRectangle( display, window, gc, 40, 40, 30, 30 ); XFlush( display ); sleep(2); XDrawRectangle( display, window, gc, 10, 10, 30, 30 ); XFlush( display ); sleep(2); XCloseDisplay( display ); exit(0); } ================================================================================ Thank you for your help. Thibaud