Re: XForms: deleting a line

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 20 Aug 97 07:26:05 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> > If you're doing something like rubber banding, you can use Xor
> > drawing.
> >
>
> Has anyone written the code to do this? I would like to select
> regions from an xyplot, and I am relatively lazy, uh, I mean I don't
> want to "reinvent the wheel", so...

Basically, the idea is

fl_drawmode( GXxor );
if ( !first_time_through )
draw_the_old_box();
draw_the_new_box();
fl_drawmode( GXcopy );

That's it.

You may need to experiment with the color to get it right. I
generally would set the GC's foreground color to 0xff.

There is an Xlib oriented discussion of this in Volume I of the
O'Reilly series -- I think under the topic of "rubber banding."

I actually don't bother with the Xor drawing much any more. I just
double buffer and redraw the entire object with a new box. Most
systems are fast enough these days that there's very little noticable
lag.

spl

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/