Solaris Common Desktop Environment: Motif Transition Guide

Chapter 3 Solaris Motif Toolkits

This chapter provides some information about Solaris 2.6 Motif and IXI Motif, and introduces the widgets available for Solaris CDE application development.

Motif Toolkits in Solaris Software

This section discusses the Solaris 2.6 Motif and IXI Motif toolkits. For a summary of the differences between the Motif toolkits available for Solaris application development, see "Summary of Motif Toolkits".

Solaris 7 Motif

Solaris 7 Motif: Based on The Open Group's Motif 2.1 with additional bugfixes and enhancements. The Solaris 7 software always includes the Motif toolkit.

Enhancements to Existing Motif 2.1 Functionality

The Solaris Motif library contains minor enhancements to Motif 2.1 usability to emulate certain OPEN LOOK user interface and Microsoft® Windows features. The usability enhancements include:

Solaris CDE Libraries for Motif

Motif Library (libXm)

Solaris CDE provides all the Motif 1.2.5 header files. The Solaris CDE libraries for Motif are the Motif 1.2.5 libraries with bug fixes and enhancements.

Motif UIL library (libUill)

The Motif user interface language (UIL) is a specification language for describing the initial state of a Motif application's user interface. The CDE version of the Motif UIL library is essentially unchanged from the Motif 1.2.5 version.

Include the UilDef.h header file (found in the /usr/dt/include/uil directory) to access UIL.

Motif Resource Manager Library (libMrm)

The Motif resource manager (MRM) is responsible for creating widgets based on definitions contained in user interface definition (UID) files created by the UIL compiler. MRM interprets the output of the UIL compiler and generates the appropriate argument lists for widget creation functions. Use libMrm to access the Motif resource manager. The CDE version is essentially unchanged from the Motif version.

Include the Mrm/MrmPublic.h header files to access libMrm in your application.

Related Documentation

See the OSF/Motif Programmer's Reference for information on UIL, the UIL compiler, UID, and Mrm.

IXI Motif 1.2.2 Toolkit

The IXI Motif 1.2.2 toolkit, which was available for Solaris 2.3 software development, contains some incompatibilities with standard OSF/Motif 1.2.2. These features are not part of the OSF/Motif 1.2 specification, and are not present in the Solaris 2.4 and later Motif toolkits.

XmList convenience functions

The following are the non-standard functions in IXI Motif. Remove them from your application code if you have used them:

XmForm widget

The XmForm widget implementation in IXI Motif and OSF/Motif 1.2.2 are different, although the APIs are identical. Hence, applications linked with IXI Motif can exhibit minor behavioral or visual differences in the XmForm widget when they are re-linked with OSF/Motif.

The Solaris Motif toolkits use the OSF/Motif XmForm widget implementation, which is binary compatible with the OSF/Motif 1.2.2, but not the IXI Motif, XmForm widget.

Complex Text Layout (CTL) Support

Solaris 7 software supports the five new CTL widgets introduced by Motif 2.1. This is achieved by a single binary developed on the Solaris 7 operating environment that provides advanced and standard support for Hebrew, Arabic and Thai customers.

The following new Motif widgets are supported.

Widgets Available for CDE Application Development

This section discusses the widgets available for Solaris CDE application development, as an extension to Solaris Motif.

Solaris Motif Control Widgets

The Solaris Motif control widgets are designed to ease porting OPEN LOOK applications to the Solaris CDE desktop by providing equivalent functionality in Solaris Motif. These widgets are not considered to be part of Solaris Motif, but rather an extension to Solaris Motif. The libDtWidget library contains widgets and functions that are used to provide common functionality across all CDE applications. The widgets provided include:

Table 3-1 CDE Control Widgets

Widget Name 

Description 

DtSpinBox

TextField widget with additional controls for incrementing and decrementing numeric values, or browsing through and selecting from a list of text strings. Can be read-only. DtSpinBox is functionally similar to the OPEN LOOK numeric text field.

DtComboBox

Combination of TextField and pop-up list widgets that provides a list of valid choices for the TextField. Can be read-only.

DtMenuButton

Command widget that provides the menu cascading functionality of an XmCascadeButton widget outside of a menu bar, or a menu pane. DtMenuButton is functionally equivalent to the OPEN LOOK menu button.

Examples of each type of widget follow:

The DtComboBox custom widget calls the Selection Callback of the Combo Box widget, instead of the List widget, when the browseSelectCallback or the defaultActionCallback is triggered for the List widget of a Combo Box.

This action may cause failure for applications that rely on the List widget Selection callback to be called when the List widget's browseSelectCallback or defaultActionCallback is triggered.


Note -

The Solaris CDE software supports all Motif 1.2 widgets.


Compatibility with Motif 2.1

The APIs of the DtSpinBox and DtComboBox widgets are similar to the Motif 2.1 release of XmSpinBox and XmComboBox widgets. The APIs are designed so an application can easily switch to the Motif 2.1 version of these widgets. The main thing you need to do to switch is to change the Dt names for the class, types, and creation routines to Xm.

This information is supplied in case you choose to port your application to Motif 2.1 but this is not a recommendation that you do so.


Note -

The Solaris CDE software does not guarantee strict API or binary compatibility between its widgets and the Motif 2.1 widgets.


Library and Header Files

The library libDtWidget provides access to the DtSpinBox, DtComboBox, and DtMenuButton widgets. The libDtWidget header files for these widgets are:

Demo Programs

You can find the Solaris Motif control widgets demos in /usr/dt/examples/dtwidget. Read the README file for detailed information on the demos.

Related Documentation

For more information on Solaris Motif control widgets, see the relevant man pages and Solaris Common Desktop Environment: Programmer's Guide.

CDE Terminal Widget

The DtTerm widget is part of the Solaris CDE development environment. It provides the functionality required to emulate an ANSI X3.64-1979-style terminal (specifically a DEC\256 VT220-like terminal with extensions). The Terminal widget library, libDtTerm, provides the DtTerm widget for adding a terminal window to a GUI. If you include a terminal in your application, use Solaris Motif widgets to add display enhancements to it such as pop-up menus and scrollbars.

The Solaris CDE Terminal application, which is a part of the run-time environment, is a window that behaves as a terminal, enabling access to traditional terminal-based applications from within the desktop. The DtTerm widget is the foundation for the desktop run-time terminal.

The libDtTerm library includes a set of convenience functions to create, access, and support the DtTerm widget.

Library and Header Files

The libDtTerm library provides a set of widgets based on Motif for designing a terminal or for adding a terminal window to a GUI.

Include the Dt/Term.h header file to access libDtTerm APIs in your application.

Demo Programs

You can find the DtTerm demos in /usr/dt/examples/dtterm. See the README file for detailed information on the demos.

Related Documentation

For more information on the DtTerm widget, see the relevant man pages.

For more information on the desktop terminal application, see the terminal help volume, the relevant man pages, or Solaris Common Desktop Environment: User's Guide.

Text Editor Widget

The CDE text editing system consists of two components:

Although the Motif text widget also provides a programmatic interface, applications that want to assure a system-wide uniform editor should use the DtEditor widget. The CDE Text Editor and Mailer applications use the editor widget. Use this widget in the following circumstances:

Library and Header Files

The DtEditor widget is in the libDtWidget library. The header file is Dt/Editor.h.

Demo Programs

A demo containing an example of the DtEditor widget (editor.c) is in /usr/dt/examples/dtwidget directory. Read the README file for detailed information on the demo.

Related Documentation

For more information on the Text Editor widget, see the relevant man pages and Solaris Common Desktop Environment: Programmer's Guide.