Preface

The OSF/Motif Programmer's Guide describes how to use the OSF/Motif[tm] application programming interface to create Motif[tm] applications. The book gives an overview of the architecture of the Motif widget set, explains features of the Motif toolkit, and presents a model and examples for constructing Motif applications.

Audience

This document is written for designers and developers of Motif programs. It does not provide sufficient information to develop new Motif widgets, although widget developers need to be familiar with the facilities and the issues discussed in this book.

This document assumes that the reader is familiar with the American National Standards Institute (ANSI) C programming language. It also assumes that the reader has a general understanding of the X Window System, the Xlib library, and the X Toolkit Intrinsics (Xt).

Applicability

This is Revision 1.2 of this document. It applies to Release 1.2 of the OSF/Motif software system.

Purpose

The purpose of this guide is to explain how to write application programs using the Motif toolkit. After reading this book, you should have a general understanding of the Motif toolkit and the Motif widget set and should be able to write applications that use them. This guide is not intended to explain how to develop new classes of widgets.

Document Usage

This document is organized into 16 chapters and two appendixes:

Related Documents

For additional information about OSF/Motif, refer to the following documents:

  • The OSF/Motif Programmer's Reference provides detailed reference information for programmers writing Motif applications.

  • The Application Enviroment Specification (AES) — User Enviroment Volume defines a stable set of routines for creating user interface applications.

  • The OSF/Motif Style Guide explains the principles of user interface design for application developers.

  • The OSF/Motif User's Guide explains how to interact with OSF/Motif applications.

For additional information about Xlib and Xt, refer to the following X Window System documents:

  • Xlib—C Language X Interfaceis the specification for Xlib.

  • X Toolkit Intrinsics—C Language Interfaceis the specification for Xt.

Typographic and Keying Conventions

This document uses the following typographic conventions:

Bold 

Bold words or characters represent system elements that an application or user must use literally, such as functions, data types, commands, flags, and pathnames. Bold words also indicate the first use of a term included in the glossary.

Italic 

Italic words or characters represent variable values and arguments that an application or user must supply.

Constant width 


Examples and information that the system displays appear in this typeface.

< > 

Angle brackets enclose the name of a key on the keyboard.

ComponentName 


Components of the user interface are represented by uppercase letters for each major word in the name of the component, such as PushButton.

Keyboard Conventions

Because not all keyboards are the same, it is difficult to specify keys that are correct for every manufacturer's keyboard. To solve this problem, this guide describes keys using a virtual key mechanism. The term virtual implies that the keys as described do not necessarily correspond to a fixed set of actual keys. Instead, virtual keys are linked to actual keys by means of virtual bindings. A given virtual key may be bound to different physical keys for different keyboards.

See Chapter 13, "Input, Focus, and Keyboard Navigation," of this book for information on the mechanism for binding virtual keys to actual keys. For details see the VirtualBindings(3X) reference page in the OSF/Motif Programmer's Reference. Since not all keyboards are the same, it is difficult to specify keys that are correct for every manufacturer's keyboard. To solve this problem, this guide describes keys using a model keyboard mechanism. Wherever keyboard input is specified, the keys are indicated by the engraving they have on the OSF/Motif model keyboard. The model keyboard does not correspond directly to any existing keyboard; rather, it assumes a keyboard with an ideal set of keys.

In addition to the standard letter, number, and character keys, the OSF/Motif model keyboard is composed of the following special keys:

  • The special printing characters </>,<\>,and <!>

  • The standard modifier keys <Ctrl>,<Alt>,and <Shift>

  • Ten function keys <F1> through <F10>

  • The arrow keys <Up arrow>,<Down arrow>,<Left arrow>,and <Right arrow>

  • <Backspace>

  • <Cancel>

  • <Delete>

  • <End>

  • <Escape>

  • <Help>

  • Either <Home>,<Begin> or both

  • <Insert>

  • <Menu>

  • <PageDown>

  • <PageUp>

  • <Return>

  • <Space>

  • <Tab>

The OSF/Motif model keyboard also contains the following optional keys, which, although useful, either are not necessary or may be created by combinations of other keys:

  • <CapsLock>

  • <Copy>

  • <Cut>

  • <Enter>

  • <ModeSwitch>

  • <NumLock>

  • <PageLeft>

  • <PageRight>

  • <Paste>

  • <ScrollLock>

  • <Select>

  • <Undo>

Throughout this guide, behavior is described in terms of model keyboard keys. When a behavior takes advantage of an optional key from the model keyboard, it is also described in terms of the required special keys. Each of the keys described on the OSF/Motif model keyboard must be available either as specified or using other keys or key combinations if the specified key is unavailable. A few of the more important alternative key bindings are described here.

  • If <Cancel> does not exist, <Escape> can be used in its place.

  • If <Help> does not exist, <F1> can be used in its place.

  • If <Menu> does not exist, <Shift> <F10> can be used in its place.

  • If <F10> does not exist, <Shift> <Menu> can be used in its place.

  • If <Home> or <Begin> does not exist, <Alt> <Left arrow> can be used in its place.

  • If <End> does not exist, <Alt> <Right arrow> can be used in its place

  • Wherever <Select> and <Space> can be used for a selection action, <Ctrl> <Space> can be used as well.