Introduction

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

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 IRIS IM 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 six 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 ViewKit's 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 ViewKit's 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.

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

Chapter 9, “The ViewKit Graph Component” 


discusses the ViewKit component for creating and displaying arc-and-node graphs.

Chapter 10, “Miscellaneous ViewKit Display Classes” 


describes a variety of components that you use primarily to display information or to manage display items.

Chapter 11, “Miscellaneous ViewKit Data Input Classes” 


describes a variety of data input classes.

Appendix A, “ViewKit Interprocess Message Facility” 


describes ViewKit's support for interprocess communication.

Appendix B, “Contributed ViewKit Classes” 


gives you an idea of how you can expand ViewKit by describing some unsupported ViewKit classes that users have contributed.

Appendix C, “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.

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 IRIS IM.

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

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

For information on OSF/Motif, see:

  • 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 IRIS IM enhancements to OSF/Motif and general tips for programming in IRIS IM on Silicon Graphics workstations, refer to the IRIS IM Programming Notes.

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

  • 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 nonprinting keyboard keys, for example, <Esc>, <Ctrl-D>

# 

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. Example of a 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.