Skip to main content

Using Xlib With Motif

  • Chapter
Book cover Programming with Motif™
  • 40 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics