Porting GIL to Motif


Guide Interface Language (GIL) is the save format used by the Sun Microsystems product Devguide.

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.

GIL Version Information

Builder Xcessory's Import GIL option (Browser:File) reads GIL version 3 (GIL-3) files exclusively.

Converting GIL-2 files to GIL-3

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:


where n is the version number.

GIL Options

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.

Setting GIL options

Select GIL Options from the Browser Options menu to display the GIL Options dialog:

GIL Options Dialog

The GIL Customization dialog allows you to set the following options:

Look and feel

Builder Xcessory attempts to match the GIL file to either a Motif or an OPEN LOOK appearance and behavior.


When set to Yes, Builder Xcessory attempts to lay out the interface based on the size changes encountered in the Motif versions of OPEN LOOK objects.

Strategies for Importing Your GIL Documents

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.

Matching interface geometry

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.

Inserting Motif manager widgets

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.


In Devguide, you can use Groups to group objects together. Builder Xcessory imports Groups as Motif bulletin boards.

Editing class names

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.

Inserting form widget parents

When the interface is imported, group anchors (attachments to other groups or objects) are ignored. In many cases, you will want to create a Motif Form widget as the parent of the group and set the attachments on the form widget's children to handle resizing properly.


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.

Installing utilities

Builder Xcessory uses the following two PBM-Plus utilities:

· icontopbm

· pbmtoxbm .

These utilities are installed in the Builder Xcessory bin directory, which must be in your path. If Builder Xcessory cannot findicontopbm and pbmtoxbm , it displays a warning message.

Devguide List

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.


Devguide actions are imported as Motif callbacks when possible. User-defined actions in Devguide are imported as the equivalent predefined callback. For example, "Show" is imported as BxManageCB.

Builder Xcessory displays a warning when it attempts to import Devguide actions that do not correspond to an equivalent Motif callback.

Non-converted Objects

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.

A number of OPEN LOOK features are not provided in Motif. Builder Xcessory ignores the following features during the import:

· The label-bold field for labels

· The label attribute on menus

· Glyphs in lists

· XView and PostScript drawing models for canvases

Conversion Conventions

You should also be aware of the conversion conventions described in the following sections.

Numeric Textfields

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.

Help Text

The help text attribute on Devguide objects is imported as the predefined callback BxHelpCB assigned to the corresponding Motif widget's XmNhelpCallback. This predefined callback creates and manages a dialog containing the help text and a dismiss button.