Skip to Content
XLIB Programming Manual, Rel. 5, Third Edition
book

XLIB Programming Manual, Rel. 5, Third Edition

by Adrian Nye
June 1994
Intermediate to advanced
821 pages
24h 40m
English
O'Reilly Media, Inc.
Content preview from XLIB Programming Manual, Rel. 5, Third Edition

Chapter 8. Events

This chapter is another must-read. Events are central to X. The fundamental framework for handling events was given in Chapter 3, but this chapter gives much more detail, both on selecting events for a window and on handling them when they arrive. It discusses each of the masks used to select events; for a description of the event structures themselves, see Appendix E.

An event, to quote the Oxford English Dictionary, is an “incident of importance” or a “consequence, result, or outcome.” This definition holds for X. An event reports some device activity or is generated as a side effect of an Xlib routine.

From a programmer’s point of view, an event reports:

  • Something that your program needs to know about, such as user input or information available from other clients.

  • Something your program is doing that other clients need to know about, such as making text available for pasting to another client.

  • Something the window manager needs to know, such as a request by your program for a change to the layout of the screen by mapping a window.

Programming with events is quite different from traditional methods of programming for input. You cannot simply wait for a user to type something and expect nothing else to happen in the meantime. Other programs are running concurrently and sharing the same system resources including the screen. They can affect your program. What happens if another window is placed over yours in the middle of the instruction your user is typing? The program ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Xlib Reference Manual for Version 11 of the X Window System

Xlib Reference Manual for Version 11 of the X Window System

Adrian Nye

Publisher Resources

ISBN: 9780596806187Supplemental ContentCatalog PageErrata