Overview
Xlib may be viewed as an “assembly language” for X. Physically, Xlib is a library of C functions, many of which translate directly into one or more protocol requests. Like a program written in assembly language, an Xlib program contains many lines of code, each of which has minimal effect. For this reason, most programmers use C instead of assembly and Motif instead of Xlib.
There are, however, times when one needs to use Xlib calls in a Motif program. While Motif provides widgets that directly support higher-order interface objects, such as menus, it does not provide functions for lower-order operations, such as drawing a line. Instead, the program must call Xlib functions to draw within the window of a Motif widget.
This chapter does not present a complete view of Xlib — that would require a book of its own. Instead, it provides a basic understanding of Xlib, including a detailed look at how the server displays images. It then presents the XmDrawingArea widget, a Motif widget that gives the programmer a “canvas” in which to place Xlib drawings. The chapter concludes with an example of XmDrawingArea in use, a “doodle” program.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1992 Springer-Verlag New York, Inc.
About this chapter
Cite this chapter
Gregory, K.D. (1992). Using Xlib With Motif. In: Programming with Motif™. Springer, New York, NY. https://doi.org/10.1007/978-1-4612-2954-4_15
Download citation
DOI: https://doi.org/10.1007/978-1-4612-2954-4_15
Publisher Name: Springer, New York, NY
Print ISBN: 978-0-387-97877-2
Online ISBN: 978-1-4612-2954-4
eBook Packages: Springer Book Archive