This example X11 code allows you to draw in a window, receive and process X events, and the like.