[vox-tech] xlib question

Micah Cowan vox-tech@lists.lugod.org
21 May 2002 19:55:41 -0700


On Mon, 2002-05-20 at 23:24, Peter Jay Salzman wrote:
> what's the difference between an xlib Window, Display and Drawable?  as in:
> 
> Window win;
> Display dpy;
> Drawable drw;
> 
> pete

I'm quite far from an xlib expert; but I do have volume 1 of the
O'reilly series handy...

Drawables consist of windows and pixmaps (offscreen memory regions you
can draw to).  You can safely specify a Window or Pixmap anywhere
Drawable is expected as argument (they're all integer types, so no
nasty, unsafe casting required).

Displays hold information about an X server and its screens.  Think of
the common "-display" option in X apps.  The Display type is a struct,
whereas (as already mentioned) Window, Pixmap and Drawable are int
types.

HTH,
Micah