Chapter 1

Athena Widgets and The Intrinsics

The X Toolkit is made up of two distinct pieces, the Xt Intrinsics and a widget set. The Athena widget set is a sample implementation of a widget set built upon the Intrinsics. In the X Toolkit, a widget is the combination of an X window or subwindow and its associated input and output semantics.

Because the Intrinsics provide the same basic functionality to all widget sets it may be possible to use widgets from the Athena widget set with other widget sets based upon the Intrinsics. Since widget sets may also implement private protocols, all functionality may not be available when mixing and matching widget sets. For information about the Intrinsics, see the X Toolkit Intrinsics-C Language Interface.

The Athena widget set is a library package layered on top of the Intrinsics and Xlib that provides a set of user interface tools sufficient to build a wide variety of applications. This layer extends the basic abstractions provided by X and provides the next layer of functionality primarily by supplying a cohesive set of sample widgets. Although the Intrinsics are a Consortium standard, there is no standard widget set.

To the extent possible, the Intrinsics are "policy-free". The application environment and widget set, not the Intrinsics, define, implement, and enforce:

Each individual widget implementation defines its own policy. The X Toolkit design allows for, but does not necessarily encourage, the free mixing of radically differing widget implementations.


1.1. Introduction to the X Toolkit

The X Toolkit provides tools that simplify the design of application user interfaces in the X Window System programming environment. It assists application programmers by providing a set of common underlying user-interface functions. It also lets widget programmers modify existing widgets, by subclassing, or add new widgets. By using the X Toolkit in their applications, programmers can present a similar user interface across applications to all workstation users. The X Toolkit consists of:

While the majority of the Intrinsics functions are intended for the widget programmer, a subset of the Intrinsics functions are to be used by application programmers (see X Toolkit Intrinsics-C Language Interface). The architectural model lets the widget programmer design new widgets by using the Intrinsics and by combining other widgets. The application interface layers built on top of the X Toolkit include a coordinated set of widgets and composition policies. Some of these widgets and policies are specific to a single application domain, and others are common to a variety of applications. The remainder of this chapter discusses the X Toolkit and Athena widget set:


1.2. Terminology

In addition to the terms already defined for X programming (see Xlib-C Language X Interface), the following terms are specific to the Intrinsics and Athena widget set and used throughout this document.

Application programmer
A programmer who uses the X Toolkit to produce an application user interface.

A widget that is contained within another "parent" widget.
The general group to which a specific object belongs.

A function that uses a widget in an application or for composing other widgets.

The name of a widget instance appended to the full name of its parent.

A specific widget object as opposed to a general widget class.

A function or procedure implemented by a widget class.

The name that is specific to an instance of a widget for a given client. This name is specified at creation time and cannot be modified.

A data abstraction consisting of private data and private and public functions that operate on the private data Users of the abstraction can interact with the object only through calls to the object's public functions. In the X Toolkit, some of the object's public functions are called directly by the application, while others are called indirectly when the application calls the common Intrinsics functions. In general, if a function is common to all widgets, an application uses a single Intrinsics function to invoke the function for all types of widgets. If a function is unique to a single widget type, the widget exports the function.

A widget that contains at least one other ("child") widget. A parent widget is also known as a composite widget.

A named piece of data in a widget that can be set by a client, by an application, or by user defaults.

A larger class of which a specific class is a member. All members of a class are also members of the superclass.

A person interacting with a workstation.

An object providing a user-interface abstraction (for example, a Scrollbar widget).

Widget class
The general group to which a specific widget belongs, otherwise known as the type of the widget.

Widget programmer
A programmer who adds new widgets to the X Toolkit.


1.3. Underlying Model

The underlying architectural model is based on the following premises:

Widgets are X windows
Every user-interface widget is associated with an X window. The X window ID) for a widget is readily available from the widget. Standard Xlib calls can be used by widgets for many of their input and output operations.

Information hiding
The data for every widget is private to the widget and its subclasses. That is, the data is neither directly accessible nor visible outside of the module implementing the widget. All program interaction with the widget is performed by a set of operations (methods) that are defined for the widget.

Widget semantics and widget layout geometry

Widget semantics are clearly separated from widget layout geometry. Widgets are concerned with implementing specific user-interface semantics. They have little control over issues such as their size or placement relative to other widget peers. Mechanisms are provided for associating geometric managers with widgets and for widgets to make suggestions about their own geometry.


1.4. Conventions Used in this Manual


1.5. Format of the Widget Reference Chapters

The majority of this document is a reference guide for the Athena widget set. Chapters three through six give the programmer all information necessary to use the widgets. The layout of the chapters follows a specific pattern to allow the programmer to easily find the desired information.

The first few pages of every chapter give an overview of the widgets in that section. Widgets are grouped into chapters by functionality.

Chapter 3Simple Widgets
Chapter 4Menus
Chapter 5Text Widgets
Chapter 6Composite and Constraint Widget

Following the introduction will be a description of each widget in that chapter. When no functional grouping is obvious the widgets are listed in alphabetical order, such as in chapters three and six.

The first section of each widget's description is a table that contains general information about this widget class. Here is the table for the Box widget, and an explanation of all the entries.

Applicadon Header file<X11/Xaw/Box.h>
Class Header file<X11/Xaw/BoxP.h>
Class NameBox

Application Header FileThis file must be included when an application uses this widget.It usually contains the class definition, and some resource macros. This is often called the "public" header file.
Class Header FileThis file will only be used by widget programmers. It will need to be included by any widget that subclasses this widget. This is often called the "private" header file.
ClassThis is the widget class of this widget. This global symbol is passed to XtCreateWidget so that the Intrinsics will know which type of widget to create.
Class NameThis is the resource name of this class. This name can be used in a resource file to match any widget of this class.
SuperclassThis is the superclass that this widget class is descended from. If you understand how the superclass works it will allow you to more quickly understand what this widget does, since much of its functionality may be inherited from its superclass.

After this table follows a general description of the default behavior of this widget, as seen by the user. In many cases this functionality may be overridden by the application programmer, or by the user.

The next section is a table showing the name, class, type and default value of each resource that is available to this widget. There is also a column containing notes describing special restrictions placed upon individual resources.

AThis resource may be automatically adjusted when another resource is changed.
CThis resource is only settable at widget creation time, and may not be modified with XtSetValues.
DDo not modify this resource. While setting this resource will work, it can cause unexpected behavior. When this symbol appears there is another, preferred, interface provided by the X Toolkit.
RThis resource is READ-ONLY, and may not be modified.
After the resource table is a detailed description of every resource available to that widget. Many of these are redundant, but printing them with each widget saves page flipping. The names of the resources that are inherited are printed in plain text, while the names of the resources that are new to this class are printed in bold. If you have already read the description of the superclass you need only pay attention to the resources printed in bold.
For each composite widget there is a section on layout semantics that follows the resource description. This section will describe the effect of constraint resources on the layout of the children, as well as a general description of where it prefers to place its children.
Descriptions of default translations and action routines come next, for widgets to which they apply. The last item in each widget's documentation is the description of all convenience routines provided by the widget.


1.6. Input Focus

The Intrinsics define a resource on all Shell widgets that interact with the window manager called input. This resource requests the assistance of window manager in acquiring the input focus. The resource defaults to False in the Intrinsics, but is redefined to default to True when an application is using the Athena widget set. An application programmer may override this default and set the resource back to False if the application does not need the window manager to give it the input focus. See the X Toolkit Intrinsics - C Language Interface for details on the input resource.


Contents Previous Chapter Next Chapter