Xlib programming

Introduction

X is a large system. It contains a full set of windowing facilities, the ability to handle colour, 2-D graphics drawing capacity, network access mechanisms, and the ability to respond to user preferences. X includes

Network connection

Compilation depends on the location of the libraries involved. The library required is usually libX11.a (on Unix systems) giving cc -o info info.c -lX11 But this may be different in your own environment.

Displaying windows (1)

Displaying windows (2)

In order to display windows with things inside them, a number of steps have to be performed.

Events

A non-exhaustive listing of X events is

A standard schema (with some minor additions) is in the program onewindow.c:

Multiple windows

Fonts

A program that uses a different font is font.c. Here are some extracts from it---the bits that would need to be changed in any of catch.c, onewindow.c, etc.

Colour

For portable applications, remember these rules:

Widgets

Simple Motif program