This Chapter briefly highlights advanced features of Motif that have not been addressed so far in this text. We also highlight related libraries that can be used to perform advanced tasks such as three-dimensional graphics. We conclude this Chapter by highlighting books, WWW and other Internet resources where further information on many aspects of X/Motif, including the above, may be readily obtained
The most current version of Motif is version 2.0 was released in late 1994. Motif 2.0 provides some significant enhancements and many bug fixes. However due to parallel development of the Common Desktop Environment (Chapter 1) Motif 2.0 is not yet in common circulation on the major UNIX platforms. During 1997 this situation is expected to change when new released of the Common Desktop Environment and Motif are due. All parties involved (the OSF and COSE) announced that CDE and Motif technologies will converge.
We now briefly summarise the key enhancements made in Motif 2.0.
Several new widgets are provided in Motif 2.0. One major reason for the development of these was to introduce greater parity with the PC. Toolkits available on the PC have, typically, offered a greater functionality than Motif -- particularly in the set of controls provided. Consequently the ComboBox (a drop down list), CSText (a multiple-font text widget), Container, Notebook, SpinBox and widgets were developed. The Scale widget was also amended so that it is easier to add tick marks along the scale as prescribed by the Motif Style Guide (Chapter 13). The key features of the new widgets is as follows:
These drop down ComboBoxes are useful when presentation space is limited, or when users will complete the text entry field more often by typing text than by choosing the entry field text from the list.
Through direct manipulation, Child widgets may also be selected and directly manipulated by the user. The user can select, move, copy or delete these objects, drag them into other applications, or drop new objects into the container.
The Container widget uses heavily uses the new (Motif 2.0) IconGadget. An IconGadget can display both text and a pixmap in various combinations. It can be displayed as a either a small or large icon. When a small icon display mode the text label is displayed to the side of the icon whereas the text is placed below the icon in large icon display mode. A major advantage of IconGadget is that it takes advantage of the general gadget caching facility from Motif. If the same icon is used hundreds times, it actually allocates it once in memory and the resources are shared.
The Notebook widget can be a versatile tool for all kinds of applications that display organized information. It can be used for:
Typical applications that could be implemented as a Notebook include card filer, agenda and calendar applications. The Notebook also provides good support for hypertext based applications.
This Motif 2.0 release had the major goal of providing support for C++. This, importantly, would allow developers to more easily build new widgets. In order to support an object oriented framework Motif required new extensible features such as subclassing, traits, C++ programming support and detailed documentation. This provided many challenges.
If basic subclassing was implemented then to fully understand Motif's class methods detailed knowledge and experience of all Xt based toolkits, and access to the source code would be required. However this is not really necessary and Motif 2.0 simplified this process allowing subclassing from the Primitive and Manager classes. Extensive new documentation is also provided in The OSF/Motif Widget Writer's Guide[Ope95c]. This book provides all necessary information to subclass from Primitive and Manager and numerous examples of subclassing are provided.
Traits are a new feature with Motif 2.0. The trait abstraction was first introduced by Xerox during the development of the Star (Chapter 1). A trait , in general, is a characteristic of an object that can be expressed by a set of methods or data and can be applied to, or carried by, the object holding that trait. At a higher level, a trait implements a behavior that can be shared by different objects of a system without requiring any particular hierarchical relationship between these objects, or any particular implementation of the trait.
Traits are therefore an important mechanism that make it possible to implement a form of multiple inheritance on top of the Xt object oriented framework (which only supports single inheritance). In the Motif 2.0 model, traits are seen as light abstract classes (sometimes called mix-ins). Traits also make it possible to implement a form of polymorphism on the various widgets. For example if a trait has a setvalue method, it can be used to set values of resources that actually have a different name (e.g. a trait::setvalue() replaces XtSetValues() on multiple XmNresource names).
In true object orientated fashion traits offer the potential for the reduction of code size in applications and also augment code re-use inside Motif. A widget writer can simply decide to inherit a Trait from another widget. It then inherits the class methods implemented.
For example, consider the navigator trait implemented in Motif 2.0. This trait characterises the fact that an object can set a value between a minimum and a maximum value, regardless of the particular method used to set the value. A navigator can be implemented by a scrollbar, a scale or even a choice in the list of all possible values. The navigator provides an abstraction which guarantees that any object carrying this trait can be used to choose arbitrarily between two values. The navigator trait implements methods that allow clients of the object carrying the trait to set and get the minimum, maximum and current values independently of the implementation. In Motif 2.0 both the ScrollBar widget and the SpinBox posses the navigator trait. They can both inherit or specialize the methods of that trait.
The number of applications developed in C++ is rapidly growing and C++ programmers are now able to derive new subclasses and still have those C++ widgets usable as regular widgets with the standard API in Motif 2.0. Appendix A gives further details on how to actually write C++ Motif programs.
The previous version of Motif (1.2) introduced major new features such as internationalisation, drag-and-drop and tear-off menus. Those features were intended to allow application developers to produce interoperable, easy to use applications for a worldwide market. As a result, this technology was selected to become the basis of the Common Desktop Environment proposed to become an X/Open standard. The CDE also provided some new widget including the ComboBox and SpinBox and extensions to some existing widgets such as the FileSelectionBox. These new features as well as the extensions added to the CDE specifications have been added to Release 2.0.
Whilst Motif still provides its own window manager,mwm 2.0 the trend toward convergence with the CDE is apparent with many common features being developed. Many of these feature have already being address in conjunction with the CDE (Chapter 3). The key desktop enhancements provided with Motif 2.0 are similar and include window and workspace management. Window and workspace Management are closely related, they deal with the very same application windows. The window manager and and the workspace manager must communicate, so that the window manager does not systematically display any window from any application.
The major new feature provide in mwm 2.0 here is the virtual screen manager which operates in a similar fashion to the CDE. Mwm 2.0 also has some useful resources that may be used to modify the behavior of the virtual screen. Since a user may not wish to have all windows on a display moved, it is possible to pin windows down so that they remain relative to the display screen. In Motif 2.0, each workspace corresponds to a virtual screen.
Since Motif 2.0 introduces an extensible object oriented framework, it was necessary to reflect these changes in the UIL language: once a developer has developed a new widget, that new widget should be usable from UIL as well. However, one does not want to have to generate a new compiler for every new widget supported. It was necessary to develop a mechanism such that the UIL compiler could dynamically incorporate new widgets to be acceptable in UIL source files and generate appropriate binary UID code.
Motif 2.0 has also made some improvements on existing widgets and performance of Motif within the X system. These are summarised below:
The ScrollBar widget has been extended to supports a look and feel where both up and down controls are close together at one end of the scrollbar, as opposed to one control at each end.
A new resource has been added to allow more control over the visual of the slider.
Motif 2.0 also makes it possible to provide feedback with the drag icon changing in real time to convey the side effects that a drop would have if it occurred at the current location of the mouse cursor.
Drag scrolling has been introduced to allow the dragging to objects currently obscured in ScrolledWindow -- the user simply moves the cursor over the scrollbar direction control and pauses. After a (customizable) delay, the scrolled window automatically starts moving itself making the destination to appear. As soon as the user moves the cursor, scrolling stops.
Motif is still undergiong development and a new release of Motif is expected sometime in 1997. It is not expected that Motif 2.1 will extend the toolkit much in terms functionality. However there are still areas of improvements. Major issues being considered for the Motif 2.1 include:
Additional toolokits are available that provide additional functionality. They are generally built on top of Xt Intrinsics and Motif.
Many applications, such as CAD modelling and Virtual Reality, require three-dimensional graphics capabilities. Three-dimensional graphics can greatly enhance many other applications. For many years the area of three-dimensional graphics suffered from a lack of standardisation. However, with the development of the Graphics Kernel System (GKS) and then PHIGS (Programmers, Hierarchical, Interactive Graphics System) three-dimensional graphics standards become established. The extension of PHIGS to the X Window system (PEX) and the adoption of PEX by COSE has established PHIGS at the forefront of these standards.
PEX basically supplies a library for C bindings to PHIGS and added support for the X server. PEX can be regarded as an extension of the X server and X protocol. There is no absolute need for Motif to run PEX applications. However, Motif and PEX do not work well together. The PHIGS toolkit provides its GUI. This GUI is does not have the look and feel of Motif nor does it provide as many useful features.
In order to ease the combination of Motif and PEX, a low level library PEXlib was developed. PEXlib provides low level access to the underlying PEX protocol much like Xlib provides access to the X protocol.
If Motif and PEX are used sensibly then Motif provides a good GUI to PEXlib which in turn renders the three-dimensional graphics. To connect Motif and PEXlib you create a Motif DrawingArea widget and the pass the widget's window ID to PEXlib in much the same that two-dimensional graphics is performed with Xlib (Chapter 17).
PEXlib is freely available. PEXlib is is released as part of X11R6 and is available in the contributed code section of X11R6. The X consortium (Chapter 1) distribute the release of X and PEXlib.
A number of thrird party toolkits have appeared in recent years that extend the functionality of Motif by providing a number of specialised widgets. A number of these are listed below:
XRT/graph displays 2-D data in virtually any type of bar chart, X-Y plot, pie chart, area graph, financial graph or logarithmic scientific chart. It has over 200 resources to fine-tune the graph's appearance and behavior. Other features include fast-updates, text areas, 3D-look on bars and pies, time- axis, user-interaction hooks and a graph builder tool.
XRT/3d displays 3-D data in surface plots, contour graphs and bar charts. It has over 140 resources, and will automatically contour and zone 3-D data using custom or default distribution tables. Users can automatically rotate, zoom and scale views. Other features include 4-D graphs, projections, histograms, text areas and user-interaction hooks.
For more information on the above contact KL Group Inc., email: firstname.lastname@example.org or URL: http://www.klg.com/.
Throughout the long journey to learn Motif there are many useful sources of reference to guide you. In recent years the Internet and the World Wide Web (WWW) has established itself as a very useful source for a variety of information types. X/Motif is no exception and the major distributors of X/Motif have WWW, email and ftp address. Many sites also contain frequently asked questions (FAQs) about general and specific X/Motif queries. News updates on major and minor release of X/Motif and tutorial material is also available. This Section provides pointers to large repositories of such information in a variety of Internet and WWW distribution mediums. We begin by giving a list of relevant reference books.
A complete list of books is given in the bibliography. For ease of reference we highlight appropriate texts that deal with specific topics addressed throughout this book.
The main WWW source of information for Motif is MW3: Motif on the World Wide Web (URL: http://www.cen.com/mw3/). From the home page you can connect to a wealth of resources for Motif and X Window System development. MW3 presently contains over 700 links. Virtually all aspects of Motif are covered here.
Other useful WWW links (URLs) include:
The Motif FAQ is available via ftp also at:
The following public mailing lists are maintained by the X Consortium for the discussion of issues relating to the X Window System. All are hosted @x.org.
To subscribe to this mailing list, send mail to the request address. In general this is specified by adding -request to the name of the desired list. Thus, to add yourself to the xpert mailing list:
To: email@example.com Subject: (none needed) subscribe
To: firstname.lastname@example.org Subject: (none needed) unsubscribe
To add an address to a specific list, or to add a specific user, you can specify options to the subscribe or unsubscribe command. This example adds email@example.com to the xpert mailing list:
To: firstname.lastname@example.org Subject: (none needed) subscribe xpert email@example.com
This mailing list is gatewayed to the newsgroup comp.windows.x.announce.
Subscription requests should be sent to firstname.lastname@example.org.
The news group comp.windows.x.motif is the main news group for Motif related issues. The following news groups exist for the discussion of other issues related to the X Window System:
Most of the above news groups have a frequently asked question section posted regularly to the news group which provide valuable information for the novice and discuss common problems. The comp.windows.x.motif are also accessible from many of the WWW sites listed in Section 21.3.2