Next: Writing Your Own Event Handler Up: XEvents Previous: XEvents

XEvent Types

There are many types of Events in Xlib. A special XEvent structure is defined to take care of this. (See Xlib Handouts for full details)

XEvents exist for all kinds of: mouse button presses, mouse motions, key presses and also events concerned with the window management.

Most of the mouse/keyboard events are fairly self explanatory and we have already studied them a little.

Let's look at some window events further:

- if a window changes size then this event is generated.
- if the stacking order of windows has changed.
- if colormap changes are made.
XCreateNotify, XDestroyNotify
- events for window creation/deletion.

XExpose, XNoExpose
- Windows can be stacked, move around etc. If part of a window that has been previously obscured becomes visible again then it will need to be redrawn. An XExpose event is sent for this purpose. An XExpose event is also sent when a window first becomes visible.

NOTE: There is no guarantee that what has previously been drawn to the window will become immediately visible. Infact it is totally up to the programmer to make sure that this happens by picking up an XExpose event (See sections of Pixmaps and DrawingAreas).
Tue May 24 16:52:56 BST 1994