5. Xlib Fundamentals   

Xlib is a set of library routines used to implement the basic X calls. It is a relatively low level function calls and more often than not, you are likely to program using the X toolkits which not only provide all the functionality of Xlib routines and is much easier to use.

But it is important to understand how the Xlib works. We will first introduce you to the concept of windows in X, learn the basic steps to create a simple X Window System application, draw lines and shapes in the window created or fill it with some text and finally add colours to the window. But we don't want a window application that does nothing but just sits on the screen. Hence, we will also find out how our window application can react to user's input such as moving and clicking of the mouse button.

The following topics are discussed:


Using Windows
Creating the Window
Displaying the Window
Cleaning up
Your first X Program!!
Drawing With X
Your second X Program!!
Text
Your third X Program!!
Colour and Visuals
Your fourth X Program!!
Events
Your last Xlib Program!!
Surprise!!

The next section is concerned with Using and Specifying X Resources.