3 The Motif Programming Model
This chapter teaches the fundamentals of Motif by example. It dissects a simple "Hello, World" program, showing the
program structure and style common to all Motif programs. Because much of this material is already covered in detail
in Volume Four, X Toolkit Intrinsics Programming Manual, Motif Edition, this chapter can be used as a refresher or a
light introduction for those who haven't read the earlier book. It makes reference to Volume One, Xlib Programming
Manual, and Volume Four to point out areas that the programmer needs to understand (windows, widgets, events,
callbacks, resources, translations) before progressing with Motif.
Though we expect most readers of this book to be familiar with the X Toolkit Intrinsics (Xt), this chapter briefly
reviews the foundations of Motif in Xt. This review serves a variety of purposes. First, for completeness, we define
our terms, so if you are unfamiliar with Xt, you will not be completely at sea if you forge ahead. Second, there are
many important aspects of the X Toolkit Intrinsics that we aren't going to cover in this book; this review gives us a
chance to direct you to other sources of information about these areas. Third, Motif diverges from Xt in some
important ways, and we point out these differences up front. Finally, we point out some of the particular choices you
can make when Xt or Motif provides more than one way to accomplish the same task.
If you are unfamiliar with any of the concepts introduced in this ...