Solaris Common Desktop Environment: Motif Transition Guide

Chapter 7 Porting Example: OPEN LOOK to Solaris Motif

This chapter presents an example of porting an OPEN LOOK application with a simple graphical user interface (GUI) to Solaris Motif. It illustrates the two-step process of porting: first translating the OPEN LOOK user interface objects one-by-one to Motif objects, then cleaning up the interface and making sure it conforms to the CDE style guide.

Of course, your goal in porting from the OPEN LOOK user interface to Solaris Motif should be to convert the GUI and clean up at the same time. The more familiar you become with the CDE style guide, the easier this will be. Also, as you learn more about Motif, learning the correlation between OPEN LOOK objects and Motif widgets will become easier.

When porting your application, take the opportunity to examine its user interface. Think about whether it could be streamlined or made more user-friendly. In going from the OPEN LOOK user interface to Motif, the application's look will change anyway. This is a good time to re-examine design decisions you made in the past.

OpenWindows 3.4 Snapshot Application

Figure 7-1 is an illustration of the OpenWindows 3.4 Snapshot application. It is running on the Solaris CDE desktop using the Motif Window Manager, so it has a Motif title bar.

The Snapshot GUI is fairly simple. It contains:

Figure 7-1 OpenWindows 3.4 Snapshot Application GUI

Graphic

Convert

Using App Builder, the Snapshot GUI translates object-for-object into the GUI shown in Figure 7-2 :

Figure 7-2 Motif Port of Snapshot GUI (Direct Translation)

Graphic

You can see that the pieces of the interface and the general layout are very similar to the OPEN LOOK version. The buttons remain, except that they are square now instead of round. The check boxes look the same. The OPEN LOOK exclusive settings have changed to Motif radio buttons (which also offer mutually exclusive choices). A small text field with no label replaces the drop target.

Clean Up

If you want, you can consider yourself finished with this application port. No functionality has been lost, and the GUI now appears in Motif. However, you should ask yourself two questions:

Consider CDE Style Guidelines

Common Desktop Environment: Style Guide and Certification Checklist highly recommends placing menu bars in applications. In addition, it considers File, Options, and Help menus as standard, to be placed in order from left to right. (Other menus are also considered standard but do not apply to the Snapshot application.)

The cleaned-up version places the Load, Save, and Print buttons under the File menu. These are typical file operations. "Beep During Countdown" and "Hide Window During Capture" are options that users have available to them, and are therefore put under the Options menu. This design decision also makes the interface less cluttered, since the text for these check boxes takes up a lot of screen space. A Help menu is added to comply with the style guidelines.

Common Desktop Environment: Style Guide and Certification Checklist calls for a footer message at the bottom of an application whenever status is displayed there. This is added to the Snapshot GUI.

Motif does not support a drop site object. CDE supports a drag source object, which appears in the final GUI as a labelled camera icon. If you want drop support, the CDE style guidelines indicate that you must provide code to enable objects to be dropped anywhere in the application's main window.

Finally, the Snap button at the bottom is highlighted, indicating that it is the default value (between Snap and View) if the user presses Return instead of pressing a button.

Other Design Considerations

The radio buttons take up a lot of screen space in the Snapshot GUI. CDE provides a widget called a DtComboBox that takes up less screen space and provides the same functionality. The Snap Type and Snap Delay radio buttons are replaced by DtComboBox widgets. The most typically used values appear as DtComboBox defaults.

You cannot use the DtComboBox widget if you are developing your application for the OpenWindows desktop. This widget is part of the CDE development environment, not the OpenWindows development environment. Even if you do have access to the ComboBox, however, you may want to retain the radio boxes, depending on issues such as ergonomics, customer needs, and consistency.

Figure 7-3 Motif Port of Snapshot GUI (Final Port)

Graphic