Introduction
Prev |  | Next

## Introduction

This guide describes how to create programs using IRIS ViewKit™, a C++ toolkit that provides commonly needed facilities for applications based on Motif or the IRIX Interactive Desktop™ user interface toolkit (the Silicon Graphics® port of the industry-standard OSF/Motif™).

## What This Guide Contains

The first two chapters of this guide provide an overview of ViewKit concepts:

Chapter 1, “Overview of ViewKit” |  | Describes the ViewKit toolkit and the advantages of using it compared to programming directly in Motif and X, discusses the major elements of ViewKit, and provides instructions for compiling ViewKit programs.
Chapter 2, “Components” |  | Describes the ViewKit component class, gives instructions for using ViewKit components, and lists guidelines for creating new components.

The next nine chapters describe the common ViewKit components that you use in practically every ViewKit program:

Chapter 3, “The ViewKit Application Class” |  | Explains the services provided by the ViewKit application class and gives instructions for controlling application-level services in your program.
Chapter 4, “ViewKit Windows” |  | Explains the ViewKit model for supporting multiple windows in an application, and describes how to create and manipulate application windows.
Chapter 5, “Creating Menus With ViewKit” |  | Describes how to create and manipulate different types of menus in a ViewKit application.
Chapter 6, “ViewKit Undo Management and Command Classes” |  | Explains how to implement support for “undoing” operations and describes how to implement actions as command classes.
Chapter 7, “Using Dialogs in ViewKit” |  | Discusses the ViewKit dialog management support, describes how to post and manipulate dialogs, and provides an overview of the different types of dialogs supported by ViewKit.
Chapter 8, “Preference Dialogs” |  | Describes how to use preference dialogs to maintain user preferences.
Chapter 9, “Handling Visuals With ViewKit” |  | Describes how to work with X and Xt visuals.
Chapter 10, “ViewKit Cut and Paste” |  | Explains how to implement cut, paste, drag, and drop capabilities.
Chapter 11, “Using a Help System With ViewKit” |  | Explains how to use a help system with ViewKit applications. It also describes the basic help system provided with ViewKit.

The rest of the book describes pre-built ViewKit components:

Chapter 12, “The ViewKit Graph Component” |  | Discusses the ViewKit component for creating and displaying arc-and-node graphs.
Chapter 13, “Miscellaneous ViewKit Display Classes” |  | Describes a variety of components that you use primarily to display information or to manage display items.
Chapter 14, “Miscellaneous ViewKit Data Input Classes” |  | Describes a variety of data input classes.
Appendix A, “Contributed ViewKit Classes” |  | Gives you an idea of how you can expand ViewKit by describing some unsupported ViewKit classes that users have contributed.
Appendix B, “Changes and Additions in ViewKit 2.1” |  | Describes the changes and additions in ViewKit 2.1 and provides information for the developer wishing to port to the new version.
Appendix C, “ViewKit Class Graph” |  | Allows you to see the ViewKit classes and how they relate to one another.

## What You Should Know Before Reading This Guide

This guide assumes that you are already an experienced C++ programmer. It also assumes that you are generally familiar with Motif.

For a thorough discussion of the concepts on which the ViewKit toolkit is based, see this book:

- Young, Douglas A. Object-Oriented Programming with C++ and OSF/Motif. Englewood Cliffs, New Jersey: Prentice Hall, Inc., 1992.

For information on OSF/Motif, version 1.2, see these guides:

- Open Software Foundation. OSF/Motif Programmer's Guide, Revision 1.2. Englewood Cliffs, New Jersey: Prentice Hall, Inc., 1992.

- Open Software Foundation. OSF/Motif Programmer's Reference, Revision 1.2. Englewood Cliffs, New Jersey: Prentice Hall, Inc., 1992.

- Open Software Foundation. OSF/Motif Style Guide, Revision 1.2. Englewood Cliffs, New Jersey: Prentice Hall, Inc., 1992.

- Heller, Dan. Motif Programming Manual (X Window System Series: Volume Six). Sebastopol, California: O'Reilly & Associates, Inc., 1992.

For information on Motif 2.1, see these guides:

- The Open Group. Motif 2.1—Programmer's Guide, The Open Group, 1997.

- The Open Group. Motif 2.1—Programmer's Reference Vol 1-3, The Open Group, 1997.

- The Open Group. Motif 2.1—Widget Writer's Guide, The Open Group, 1997.

For information on IRIX Interactive Desktop (IID) enhancements to OSF/Motif and general tips for programming in IID on Silicon Graphics workstations, refer to the IRIS IM Programming Guide.

For comprehensive information on the X Window System™, Xlib, and Xt, see these manuals:

- Nye, Adrian. Xlib Programming Manual (X Window System Series: Volume One). Sebastopol, California: O'Reilly & Associates, Inc., 1992.

- O'Reilly & Associates, Inc. Xlib Reference Manual (X Window System Series: Volume Two). Sebastopol, California: O'Reilly & Associates, Inc., 1992.

- Nye, Adrian, and Tim O'Reilly. X Toolkit Intrinsics Programming Manual (X Window System Series: Volume Four). Sebastopol, California: O'Reilly & Associates, Inc., 1992.

- O'Reilly & Associates, Inc. X Toolkit Intrinsics Reference Manual (X Window System Series: Volume Five). Sebastopol, California: O'Reilly & Associates, Inc., 1992.

## Conventions Used in This Guide

This section describes the conventions used for presenting information in this book.

### Typographical Conventions

These type conventions and symbols are used in this guide:

Bold |  | C++ class names, C++ member functions, C++ data members, function names, literal command-line arguments (options and flags)
Italics |  | Filenames; onscreen button names; IRIX™ commands; executable files; manual and book titles; glossary entries; new terms; variable command-line arguments; program variables; and variables to be supplied by the user in examples, code, and syntax statements
`Screen type` |  | Onscreen text, prompts, error messages, examples, and code listings
`Bold screen type` |  | User input, including keyboard keys (printing and nonprinting); literals supplied by the user in examples, code listings, and syntax statements
““ |  | (Double quotation marks) Onscreen menu items and references in text to document section titles
() |  | (Parentheses) Follow function names; also used to surround reference page (man page) section in which a command, function, or class is described
<> |  | (Angle brackets) Surround header filenames
# |  | IRIX shell prompt for the superuser (root)
% |  | IRIX shell prompt for users other than superuser

Reference pages (also known as man pages) are referred to by name and section number, in this format: name(section), where “name” is the name of a command, system call, library routine, or class; and “section” is the section number where the entry resides. For example, XtSetValues(3Xt) refers to the `XtSetValues()` reference page in section 3Xt.

### Class Inheritance Graph Conventions

Most of the chapters in this book begin with a graph depicting the inheritance hierarchy of the classes described in that chapter. Figure i shows an example of a class inheritance graph that might appear at the beginning of a chapter.

Figure 1. Class Inheritance Graph

In these inheritance graphs, classes are presented with the base classes to the left and the derived classes to the right. Abstract classes have dashed borders and non-abstract classes have solid borders. Classes described within the chapter appear in white boxes, whereas classes described elsewhere appear in shaded boxes.

In the inheritance graph shown in Figure i, `VkComponent` is an abstract base class. As indicated by its shaded box, it is not described within the chapter. The chapter describes three subclasses of `VkComponent`: `VkDoubleBuffer`, an abstract class; and `VkTickMarks` and `VkResizer`, non-abstract classes. The chapter also discusses the non-abstract class `VkAlignmentGroup`, which is derived from the non-abstract base class `VkWidgetList`.

Prev | Table of Contents | Next
What's New |  | Chapter 1. Overview of ViewKit