Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!swbatl!sarek.sbc.com!mh2620 From: mh2620@sarek.sbc.com (Mark Horstman) Newsgroups: comp.windows.x Subject: Problems w/XDrawRectangle, rubberbanding Keywords: XDrawRectangle, rubberband Message-ID: <1990Sep27.161240.14668@swbatl.sbc.com> Date: 27 Sep 90 16:12:40 GMT Sender: usenet@swbatl.sbc.com (0000-news(0000)) Reply-To: mh2620@sarek.sbc.com Organization: Southwestern Bell Telephone - St. Louis, MO Lines: 44 I'm trying to put a rubberbanding feature in my application with the following code to draw and undraw the rubberband (which looks a lot like the 'draw_box' routine in the O'Reilly X manual Volume 2 section 14.7.13): static GC RBgc = NULL; Widget iWidget; void drawRB( x, y, w, h ) int x, y; unsigned int w, h; { if ( w && h ) { if ( RBgc == NULL ) { RBgc = XCreateGC( XtDisplay( iWidget ), XtWindow( iWidget ), 0, NULL ); XSetForeground( XtDisplay( iWidget ), RBgc, BlackPixel( XtDisplay( iWidget ), DefaultScreen( XtDisplay( iWidget ) ) ) ); XSetBackground( XtDisplay( iWidget ), RBgc, WhitePixel( XtDisplay( iWidget ), DefaultScreen( XtDisplay( iWidget ) ) ) ); XSetFunction( XtDisplay( iWidget ), RBgc, GXxor ); } XDrawRectangle( XtDisplay( iWidget ), XtWindow( iWidget ), RBgc, x, y, w, h ); } } This works fine on the Sun sample server and on NCD X-terminals, but I can't get the rubberband to show up on anything else (I've tried an RS/6000, an IBM X-station, a Tektronics X-terminal, and a couple X servers for DOS). What am i doing wrong? +----------------------------------------------------------------------------+ | Mark A. Horstman Southwestern Bell Telephone | | mh2620@sarek.sbc.com St. Louis, MO | | OR uunet!sarek.sbc.com!mh2620 (314) 235-3417 | +----------------------------------------------------------------------------+