1.3 How This Book Is Organized
While this book attempts to serve the widest possible audience, that does not imply that the material is so simple that
it is only useful to novice programmers. In fact, this book can be considered an advanced programmer's handbook,
since in many places, it assumes a fairly sophisticated knowledge of many features of the X Window System.
Each chapter is organized so that it gets more demanding as you read through it. Each chapter begins with a short
introduction to the particular Motif element that is the subject of the chapter. The basic mechanics involved in creating
and manipulating the object are addressed next, followed by the resources and other configurable aspects of the object.
If there is any advanced material about the object, it is presented at the end of the chapter. Many chapters also include
exercises that suggest how the material can be adapted for uses not discussed explicitly in the text.
While the chapters may be read sequentially, it is certainly not required or expected that you do so. As you will soon
discover, there are many circular dependencies that justify skipping around between chapters. Since there is no
organization that would eliminate this problem, the material is not organized so that you "learn as you go." Instead, we
organized the material in a top−down manner, starting with several chapters that provide an introduction to the Motif
look and feel, followed by chapters organized on a widget−by−widget basis. The higher−level manager widgets are
discussed first, followed by the primitive widgets and gadgets. Advanced material is positioned at the end of the book,
since the details are not of paramount importance to the earlier material. The last four chaapters are devoted to UIL.
In short, everything is used everywhere. Starting at the beginning, however, means that we won't necessarily assume
you know about the material that is referenced in later chapters. On the other hand, the later chapters may make the
assumption that you are aware of material in earlier chapters.
The book is broken down into twenty six chapters and one appendix as follows:
Chapter 1
Introduction to Motif answers the question "Why Motif?" and suggests some of the complexities that the
programmer has to master in order to make an application easy to use.
Chapter 2
The Motif Programming Model teaches the fundamentals of Motif by example. It presents a simple "Hello,
World" program that shows the structure and style common to all Motif programs. Much of this material is
already covered in detail in Volume Four, X Toolkit Intrinsics Programming Manual, Motif Edition, so the
chapter can be read as a refresher, or a light introduction for those who haven't read the earlier book. The
chapter references Volume Four and Volume One, Xlib Programming Manual, to point out areas that the
programmer needs to understand before progressing with Motif.
Chapter 3
Overview of the Motif Toolkit explains what is involved in creating a real application. The chapter discusses
the arrangement of primitive widgets in an interface, the use of dialog boxes and menus, and the relationship
between an application and the window manager. The chapter also describes all of the changes in Release 1.2
of the Motif toolkit. After reading this chapter, the programmer should have a solid overview of Motif
application programming and be able to read the remaining chapters in any order.
Chapter 4
The Main Window describes the Motif MainWindow widget, which can be used to frame many types of
applications. The MainWindow is a manager widget that provides a MenuBar, a scrollable work area, and
various other optional display and control areas.
Chapter 5
Introduction to Dialogs describes the fundamental concepts that underly all Motif dialogs. It provides a
foundation for the more advanced material in the following chapters. In the course of the introduction, this
chapter also provides details on Motif's predefined MessageDialog classes.
1 Preface 1.3 How This Book Is Organized
3
Chapter 6
Selection Dialogs presents the more complex Motif−supplied dialogs for displaying selectable items, such as
lists of files or commands, to the user.
Chapter 7
Custom Dialogs describes how to create new dialog types, either by customizing Motif dialogs or by creating
entirely new dialogs.
Chapter 8
Manager Widgets provides detailed descriptions of the various classes of Motif manager widgets. Useful
examples explore the various methods of positioning components in Form and RowColumn widgets.
Chapter 9
ScrolledWindows and ScrollBars describes the ins and outs of scrolling, with particular attention to
application−defined scrolling, which is often required when the simple scrolling provided by the
ScrolledWindow widget is insufficient.
Chapter 10
The DrawingArea Widget describes the Motif DrawingArea widget, which provides a canvas for interactive
drawing. The chapter simply highlights, with numerous code examples, the difficulties that may be
encountered when working with this widget, rather than trying to teach Xlib drawing techniques. Some
knowledge of Xlib is assumed; we direct the reader to Volume One, Xlib Programming Manual, for
additional information.
Chapter 11
Labels and Buttons provides an in−depth look at labels and buttons, the most commonly−used primitive
widgets. The chapter discusses the Label, PushButton, ToggleButton, ArrowButton, and DrawnButton widget
classes.
Chapter 12
The List Widget describes yet another method for the user to exert control over an application. A List widget
displays a group of items from which the user can make a selection.
Chapter 13
The Scale Widget describes how to use the Scale to display a range of values.
Chapter 14
Text Widgets explains how the Text and TextField widgets can be used to provide text entry in an application,
from a single data−entry field to a full−fledged text editor. Special attention is paid to problems such as how
to mask or convert data input by the user so as to control its format. The chapter also discusses the
internationalization features of the widgets provided in Motif 1.2.
Chapter 15
Menus describes the menus provided by the Motif toolkit. The chapter examines how menus are created and
presents some generalized menu creation routines.
Chapter 16
Interacting With the Window Manager provides additional information on the relationship between an
application and the Motif Window Manager (mwm). It discusses the shell widget resources and window
manager protocols that can be used to communicate with the window manager.
Chapter 17
The Clipboard describes a way for the application to interact with other applications. Data is placed on the
clipboard, where it can be accessed by other windows on the desktop, regardless of the applications with
which they are associated.
Chapter 18
Drag and Drop presents the drag and drop mechanism for transferring data that is provided in Motif 1.2. The
chapter describes the built−in drag and drop features of the Motif toolkit and provides examples of adding
drag and drop functionality to an application.
Chapter 19
1 Preface 1.3 How This Book Is Organized
4
Get Volume 6A: Motif Programming Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.