There are currently three major families of X widgets:
In practice, most commercial software releases tend to use Motif, because it looks like Microsoft Windows, and most free software tends to use the Athena widget set, because it is freely distributable.
There is a freely distributable version of the Athena widget set which has been enhanced with a 3-D appearance: This seems to be slowly becoming the standard widget set for free net software, and is the widget set on which this tutorial concentrates.
Typical client-end X software consists of three basic layers:
xlib
library, which handles
the details of converting C function calls and
datatypes to and from network packets. Only
fools, wizards and the truly desperate plumb
these depths.
Xt
intrinsics library,
which implements the basic mechanisms underlying
all three of the above widget families. Very
important to people implementing new widget
sets, largely invisible to people merely using
off-the-shelf widgets.
Since the Intrinsics library implements a vaguely object-oriented single-inheritance scheme which allows new widgets to be defined as specializations of existing widgets, all three of the above widget sets come organized as familiy trees, with the most generic functionality at the top and the most specialized widgets at the leaves of the tree.
Let's start with an overview of the Athena widget family tree. We'll present widgets directly accessible via WAFE in ALL CAPS: The others are internal structural components only.
The first branch of the tree, the simple widgets, contains most of the widgets likely to catch your eye when glancing at an X interface: The leaf widgets which present a datum for display or a control to be operated:
core SIMPLE # Rectangle with optional border and cursor shape LIST # Display & select from list of strings. PANNER # Two-dimensional slider TEXT # Display/search/edit/scroll text. asciiText 3d GRIP # Mostly used by "Paned" widget SCROLLBAR # Horizonal or vertical elevator+channel. CLOCK # Special-purpose widget STRIPCHART # Realtime scrolling stripchart LABEL # Display bitmap/string COMMAND # Also sense clicks MENUBUTTON # Pop up submenu when clicked TOGGLE # Alternate states when clicked. REPEATER # Repeat some action while depressed
As you might expect, the text widget is a relatively large widget for displaying text in paragraph-size quantities (or larger), while the label widget (and its specializations) are used for smaller icons, pushbuttons and the like. You'll use these heavily; The rest are more specialized or present mainly for internal implementation purposes.
Toggle buttons may be used alone, or may be used in groups to implement one-of-many selections, sometimes called "Radio buttons".
The rect branch of the tree is closely
related to the simple
branch, containing
widgets specifically designed to be clustered
into a simpleMenu
:
rect SME # "Simple Menu Entry". Blank menu space. SMELINE # Divider bars on menus sme3D # Internal class SMEBSB # Can display "Bitmap, String, Bitmap"
In general, it is not enough to be able to place simple widgets here and there by hand: We would like to have tools which automate the layout task for us, organizing logically related sets of simple widgets on the screen into clusters that operate together in a natural way.
Athena calls these composite widgets, naturally enough, and supplies the following basic set:
core composite BOX # Simple packed row-column layout. PORTHOLE # Clipping widget, usually used with a panner. constraint PANED # Simple horizontal or vertical stacked layout. LAYOUT # Sophisticated TeX-style layout. TREE # Special-case layout for trees. FORM # Edge- and widget-relative layout. DIALOG # Prompt user for filename (&tc). VIEWPORT# 1 or 2 scrollbars + a peephole onto a larger widget
Finally, we need special treatment for the widgets that represent a complete window in the everyday window-manager sense of something which appears and disappears as a whole: Full-scale windows decorated by the window manager with titlebar and so forth, and also pop-up menus which can appear anywhere on demand and hence are really separate windows also.
Athena calls these shell widgets and provides the following hierarchy:
core composite shell OVERRIDESHELL SIMPLEMENU # Basic pop-up menu wmShell vendorShell TOPLEVELSHELL APPLICATIONSHELL # Most normal windows TRANSIENTSHELL # Extra windows
Application shells are the vanilla top-level windows which can be iconified, resized and so forth via the usual window manager decorations. You get one of these "for free" when you start up WAFE, and this will often be the only shell needed by the application.
TopLevel shells are used when you want a second window associated with the main application shell window, and want the second window to be separately iconifiable and so forth, just like the primary application shell.
Transient shells bypass the window manager, and are typically used for auxilliary control panels related to the main application shell, for which normal window manager control would be inappropriate.
Note: The logo and mailbox widgets are omitted from the above summary because they have been dropped from the Athena widget set as of Release 6.