[comp.windows.x] How to erase lines and rectangles?

tian@tove.umd.edu (jianhui Tian) (07/15/89)

Help! Help!

I am a new X window system user. In the process of writing applications,
I have encountered with the problem or erasing lines and blocks.
[Acturally I am trying to make blocks(rectangles) appear to be moving
 by erase the old ones and redraw the new ones]
I have tried both
			XClearArea()
	and		XFillRectangle()
But none of them worked.

It seems that XClearArea only works in text windows; and XFillRectangle
only toggles the initial contents inside the rectangle area.

Can anyone in the net tell me what Xlib function to use....

Thanks a lot in advance.


Jeff Tian

rws@EXPO.LCS.MIT.EDU (07/17/89)

If your application is only using two colors, you can use the function
GXxor or GXinvert to "undo" graphics.  If you are using more, it's harder.
Try reading sections 7.4.1 through 7.4.3 in the O'Reilly books, Volume 1
(also found in the R3 distribution in doc/tutorials/color.tbl.ms).