[comp.windows.x] X10 to X11 translation, or you are confused

RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) (06/04/88)

    Date: 3 Jun 88 22:21:48 GMT
    From: tikal!ole!powell@beaver.cs.washington.edu  (Gary Powell)

    In X11 it appears that to save a portion of the window in a pixmap
    I  do the following.

You code doesn't really do much of anything.  You've got regions,
clipping, and pixmap creation rather confused.

    Now how do I get this pixmap to replace what is currently in the window?

XCopyArea.

    Am I correct in assuming that a region is a "Drawable"?

No.  A Region should be thought of as an arbitrary set of pixel
locations.  It is a client-side abstraction.

    Have I created a pixmap of the area between llx,lly and urx,ury?

No.  You've attempted to create a pixmap (except it will fail miserably
because a region isn't a drawable), but you've put no useful contents in
it.  You've also done strange things with a GC.  I think you need to
reread the Xlib manual a few more times (or find a tutorial).

    What I am doing is trying to save a state of the screen so that I can
    redraw it when I am done with an overlapping display.

If your "overlapping display" is a window, you should be enabling
save-under on that window, and letting the server do the job for you.

    Are pixmaps also drawables?

Yes.

    Do I send the resulting pixmap to the display via XPutImage?

No, with XCopyArea.

    Or instead of the XCreatePixmap should I be using XGetImage?

Yes, you could do that, but if you are planning to use this to snapshot
an arbitrary rectangle on the screen, with pieces of arbitrary windows,
you can be sure it will not do what you desire on some collection of
servers, since the windows may have different depths.