

     :
     :

   |>    XSetFunction( myDisplay, gc, GXxor);
   |>    XSetForeground( myDisplay, gc, drawIndex);
   |> 
   |> Then to draw I do:
   |> 
   |>    XDrawLine( myDisplay, XtWindow( drawingArea1), gc, x1, y1, x2, y2);
   |>    XFlush( myDisplay);
   |> 
   |> And when I'm all done, to return things to normal I do:
   |> 
   |>    XSetFunction( myDisplay, gc, GXcopy);
   |> 
   |> 
   |> What I'd like to happen is for the lines I draw to be the inverse of
   |> whatever I'm drawing over.  Instead what happens is I get white lines.  If
   |> the lines are over a white background - nothing shows up.  If the lines are
   |> over a black area - nothing shows up!  It's very strange.  But the GXxor
   |> function seems right - since if I do a rubber-banding box, it erases and
   |> redraws itself correctly (ie. not disturbing the underlying image).
   |> 
   |> Any suggestions what I'm doing wrong?
   |> 
   |> david


      Try change the GXxor to GXequiv.  I have to do this for programs that
      are to run on NCD terminals (on Sun terminals I have to change it
      back to GXxor)...

There is a small section in the O'Reilly Xlib books that describes
the right thing to do.  The key is to set the plane_mask in the
GC to the OR of the foreground and background pixel values.


