Jump to content

Xlib Programming Basics

From IdeaWazaWiki
Revision as of 16:03, 30 November 2008 by wikademia>Darklama (+initial introduction to the basic breakdown of a program using Xlib)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Xlib is an application programming interface (API) for X Window. A program which uses Xlib can be broken down into 4 parts:

  • Opening a connection to a X Window server, using the default display or specifying a specific screen and display to use.
  • Create windows for the user interface and map them so they are shown to the user
  • Respond to events received from the X Window server, by drawing on windows or taking other actions. This includes the initial event to draw the content of each window for the first time.
  • Close a connection to a X Window server in response to a user's action when the time is right. Like for example when clicking quit from a menu.