A tutorial of Xlib.

http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html

And I strongly recommend you go to the Tutorials homepage. The author has made a series of illustrative articles.