[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Widget Writer's Guide



Defining the Goal

The primary goal for Motif widget writers is to create a self-contained object that satisfies the Motif Style Guide conventions and interacts appropriately with other Motif widgets. Another important goal is to write widget code that conforms to the widget coding guidelines presented in Chapter 2.

By "self-contained object," we are suggesting that you follow good object-oriented design rules. For example, any widget that you create should itself be subclassable. Design for reuse.

Neither Motif nor the Intrinsics will be able to verify that you have followed the dictates of the Motif Style Guide. However, Motif users will know when you have not followed the conventions. If you are not yet familiar with the Motif Style Guide, you should become so. In order to give your new widgets that all-important Motif look and feel, your widgets should do the following:

  1. Inherit (or envelop) methods from XmPrimitive and XmManager, whenever possible.

  2. Use the internal Motif widget writer functions (the Xme functions), whenever possible. The standard Motif widget set uses the Xme functions extensively. For example, the XmeDrawShadows function draws a Motif style shadow inside a widget. Therefore, there is no good reason to invent your own shadow drawing routine when you can call the existing one.

  3. Specify translations and actions consistent with the Motif Style Guide. In other words, respond to events as similar Motif widgets would.

  4. [ Previous | Next | Contents | Glossary | Home | Search ]