1 Naming conventions
In general, names in the Lisp Motif interface are derived directly from
the C original. The following rules apply:
- Drop Xt" and Xm (also XmN,
XmC, etc.) prefixes
- Separate words by dashes (-) rather than capitalization
- Resource names and enumeration values are given as keywords
- Replace underscores (_) with dashes (-)
Examples:
XtCreateWidget | ⇒ | create-widget |
XmNlabelString | ⇒ | :label-string |
XmVERTICAL | ⇒ | :vertical |
Some exceptions:
- Compound string functions XmString… are prefixed by
compound-string- rather than string- in Lisp.
Functions or resources, with the exception of the compound-string-xxx
functions, which require compound string arguments, may be given Lisp
SIMPLE-STRINGs instead.
The arguments to functions are typically the same as the C Motif
equivalents. Some exceptions are:
- Widget creation functions have a &rest arg for
resource values.
- Functions which take a string table/length pair in C only take a
list of strings in Lisp.
- Registering functions such as ADD-CALLBACK use a
&rest arg for registering an arbitrary number of
client-data items.