Motif: origins and development — MotifCentral

MotifCentral:/motif

Motif: origins and development

The toolkit, its place in UNIX desktops, and the distinction between Motif, Open Motif and LessTif.

Motif's library is libXm: the widgets used to construct menus, dialogs, text fields and other application controls.

The toolkit sits on Xt and Xlib. Its window manager, mwm, is a separate program.

What Motif looks like

This small application uses XmLabel, XmPushButton and XmRowColumn. Motif draws the raised button borders and keyboard-focus indication; Xt provides resource handling and event dispatch underneath them.

Motif counter with bevelled Count, Reset and Quit buttons and a click total.
Built and captured with the locally compiled Motif library. The surrounding frame is drawn by mwm; colours and fonts are resource settings in the example.

Download motif-counter.c. With Motif, Xt and Xlib development files installed:

cc -std=c99 -Wall -Wextra -o motif-counter motif-counter.c -lXm -lXt -lX11
./motif-counter

Count, Reset and Quit use activation callbacks, so the buttons work with the keyboard as well as the mouse. The status label uses an XmString; the example frees its temporary string after setting the label resource.

A shared interface for UNIX applications

Motif emerged from the Open Software Foundation's work on a common UNIX software environment. The Open Group's historical timeline records OSF's formation in 1988 and the shipment of Motif 1.0 in 1989. That places it in the workstation era, when applications needed to operate across different vendors' UNIX systems. Source: The Open Group's UNIX timeline

A shared toolkit gave application developers a common set of controls. A style guide addressed how those controls should behave together: menu organisation, dialog conventions and keyboard interaction matter as much as a button's bevel. The Motif programming literature treats interface design alongside the API. Source: Motif Programming Manual

Motif, the window manager and CDE

These related names describe different pieces:

NameRole
libXmMotif's widget library, linked into applications.
mwmThe Motif Window Manager, responsible for managing top-level windows.
UIL and libMrmA language and runtime facilities for describing and constructing interfaces.
CDEA desktop environment that uses Motif and adds applications and desktop services.

CDE is an important example of Motif's use. Its own documentation includes an application builder and separate programming, internationalisation and style guides. Sources: CDE overview and CDE documentation.

The Open Group's standards catalogue also records the 1995 Motif Toolkit API specification, C320, and its relationship to CDE. This is useful evidence of Motif's role as an interface standard as well as an implementation. Source: historical standards catalogue

Motif, Open Motif and LessTif

Older instructions use these names in ways that can be confusing. Open Motif belongs to the Motif code lineage. LessTif was an independent implementation intended to provide a compatible, freely available alternative; it was not simply another release of the same source tree.

The LessTif project's own account explains its motivation and identifies Motif's 2012 change to the LGPL as a turning point. The Motif project distributes its source under LGPL terms. When working with an old release, read that release's licence and documentation rather than assuming a later release's terms or behaviour apply. Sources: LessTif project history and Motif project.

Studying Motif through working code

A useful next step is to compare a small example with a larger program. The Motif source distribution contains demonstration programs; CDE provides examples of a complete desktop built around the toolkit. Look for widget construction, resource settings and callback registration before trying to understand every line.

Historical source and documentation are also collected in the archive guide. For a practical introduction, build your first Motif application, then follow the programming resources.

Ready. libXm / Xt / Xlib