Porting GIL Interfaces to Motif
Builder Xcessory reads GIL files and imports the interface generated from Devguide into a Motif interface. However, Devguide is a tool for developing OPEN LOOK interfaces, and many differences between the interface objects provided by OPEN LOOK and those provided by Motif prevent the conversion from being completely automated.
If you have GIL-2 files, you can convert them to GIL-3 by reading them into Devguide Version 3, and then saving them. To determine the version of your GIL file, examine the first line of the file, which contains the following characters:
Builder Xcessory imports a GIL file similarly to the way it reads a UIL file. The interface is added to the interface currently in Builder Xcessory. You can also customize certain options when importing a GIL file.
When you import a GIL file, you must decide whether to port the interface with as few changes as possible (thus saving a Motif program that mostly conforms to the OPEN LOOK style guide) or to allow Builder Xcessory to match the interface as closely as possible to Motif look and feel. The Import GIL dialog allows you to specify whether to match the interface to Motif or OPEN LOOK look and feel.
The Motif versions of OPEN LOOK objects also alter the geometry of the GIL interface. The GIL Options dialog allows you to specify whether Builder Xcessory should try to lay out the interface based on the size changes.
Both options are likely to result in some overlapping or misaligned objects, but you can easily reposition the objects from within Builder Xcessory. In many cases, the best way to align and position objects is to insert managers such as Forms and RowColumns into the hierarchy. A good understanding of how the different Motif managers work is necessary.
For the cases in which you do not want the groups mapped to a Motif BulletinBoard, you can edit the Class Name field in the Resource Editor and change the group's Class Name. Also change the instance name to reflect the new Class name or the object's function in the interface.
When there are glyphs in the GIL file that are stored in the Sun Microsystems, Inc. Icon format, Builder Xcessory automatically imports the Icon files in an XBM format. If Builder Xcessory cannot find the Icon file to be converted, a message specifies the commands required to convert the file, once you locate it.
Certain Devguide objects map well to collections of Motif 1.2 widgets. The Devguide List with a label maps to a frame widget with scrolled list and label children. However, Motif 1.1 does not support multiple children of a Frame widget. If you are using Motif 1.1, use a form widget in place of the frame. Builder Xcessory does the Motif 1.2 version of the import by default, unless you have specified Motif 1.1 code generation on the General tab of the User Preferences dialog.
Drop targets and group anchors are ignored when a GIL file is imported by Builder Xcessory. The differences between Devguide/OPEN LOOK and Motif are significant enough that importing these objects is not useful.
Numeric textfields are created as Motif text field widgets with a modifyVerify callback set to BxVerifyNumericCB. This callback allows only digits to be entered into the text field. It does not support Devguide attributes such as minimum and maximum range, nor the increment and decrement arrow buttons.
Builder Xcessory creates a MenuBar for every OPEN LOOK menu that it encounters, because menus under the OPEN LOOK Style Guide are commonly distributed throughout an interface. Motif interfaces typically have all of their menus in a single menu bar at the top of the window.
Consequently, after importing a GIL file the first thing that you will often do is to combine the various MenuBar/CascadeButton combinations into a single MenuBar with multiple cascadeButton children. Also consider creating a single MainWindow widget at the top of your object instance hierarchy and having it contain the main MenuBar and a manager widget that controls all of the other widgets in the window.