Although the APIs are different, both XView and Motif are based on the same object-oriented methodology for programming a user interface:
Initialize the toolkit
Instantiate user interface objects
Enter event loop, waiting for user to generate events on the user interface objects
The overall structure of a program being ported from XView to Motif can remain intact even though all the function calls must be converted from one API to the other.
Both XView and Motif are user interface toolkits that support some common types of user interface objects. However, XView implements many of these objects at a higher level that requires more than one Motif widget to produce the equivalent of a single XView object.
Table 5-3 lists the basic mapping of common objects for XView and its equivalent Solaris Motif widget:
Table 5-3 Basic Mapping of Common Objects.
Equivalent Solaris Motif Widget |
|
---|---|
Base Frame |
XmTopLevelShell + XmMainWindow |
Command Frame |
XmDialogShell + XmBulletinBoard |
Notice |
XmDialogShell + XmMessageBox (MessageDialog) |
Canvas |
XmScrolledWindow + XmDrawingArea |
Panel |
XmBulletinBoard or XmForm |
Panel Button |
XmPushButton |
Menu Button |
DtMenuButton (not accessible in OpenWindows environment) |
Abbrev Menu Button |
XmRowColumn (Option Menu) |
Checkbox |
XmRowColumn + XmToggleButtons (CheckBox) |
Exclusive Choice |
XmRowColumn + XmToggleButtons (Radio Box) |
Scrolling List |
XmScrolledWindow + XmList |
Message |
XmLabel |
Slider |
XmScale |
Text Field |
XmTextField |
Numeric Text Field |
DtSpinBox (not accessible in OpenWindows environment) |
Text SubWindow |
XmScrolledWindow + XmText (ScrolledText) |
TTY SubWindow |
XmScrolledWindow + XmTermPane; DtTerm (not accessible in OpenWindows environment) |
Scrollbar |
XmScrollBar |
Popup Menu |
XmMenuShell + XmRowColumn (Popup Menu) |
Pulldown Menu |
XmMenuShell + XmRowColumn (Pulldown Menu) |
Pullright Menu |
XmMenuShell + XmRowColumn (Pulldown Menu) |
File Chooser |
XmDialogShell + XmFileSelectionBox |