 RE: Drawing Lines 
Organization: The Internet
Lines: 51
NNTP-Posting-Host: enterpoop.mit.edu
To: , 

#
#I'm trying to write some code that lets me draw lines and do rubber-band
#boxes in Motif/X.  I'm running on an 8-bit display for which I've created a
#colormap and am using almost all of the colors.  I want to draw the lines
#in a drawing area widget -- a widget in which I'm displaying a bitmap using
#XPutImage.  If doesn't matter if the lines I draw interactively stay
#around when the window is refreshed.
#
#Currently, to draw interactively, I begin with:
#
#   /* drawIndex is an colortable index I reserve for the Foreground */
#   /* my_default_bg_color is the color index for the background of my image */
#   palette_colors[drawIndex].red =   palette_colors[my_default_bg_color].red;
#   palette_colors[drawIndex].green = palette_colors[my_default_bg_color].green;
#   palette_colors[drawIndex].blue =  palette_colors[my_default_bg_color].blue;
#   XStoreColors;
#   XFlush;
#
#   XSetFunction;
#   XSetForeground;
#
#Then to draw I do:
#
#   XDrawLine( myDisplay, XtWindow, gc, x1, y1, x2, y2);
#   XFlush;
#
#And when I'm all done, to return things to normal I do:
#
#   XSetFunction;
#
#
#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 .
#
#Any suggestions what I'm doing wrong?
#

I believe for this to work on a color display you must set the foreground of
the GC to be .

Patrick L. Mahan

--- TGV Window Washer -------------------------------  ---------

Waking a person unnecessarily should not be considered  - Lazarus Long
a capital crime.  For a first offense, that is            From the Notebooks of
							  Lazarus Long
