This appendix describes a suggested set of conventions for naming widgets, and elements within widget code.
This appendix proposes a set of conventions for naming certain elements of widget code.[111]If the naming conventions used in all widget sets are consistent, there will be several benefits:
It will be much easier for programmers to move from toolkit to toolkit without needing to constantly refer to manuals to figure out how to properly name various items.
It will be easier to mix widgets from different widgets sets in one application.
It will make it possible for automatic code generators to work with lots of widgets without making special modifications for any toolkit.
These conventions are common between the OPEN LOOK and Motif widget sets with a few minor differences. However, the Athena widget set currently does not follow the conventions described.
It is important to note that these suggestions are in no way blessed (or damned) by the X Consortium--they are simply a guideline that we suggest you follow in the interests of promoting the benefits listed above. We will use Motif as an example.
A toolkit uses a special prefix with all its widgets. In the case of Motif, this prefix is m. Using that prefix and a hypothetical Label widget as an example, the conventions are as follows:
OPEN LOOK uses conventions similar to Motif, but leaves the prefixes off the widget class name. We recommend that you supply a prefix for any widgets you write, especially if there is any chance that some other widget set may use the same class name. In other words, if we wrote a new Label widget, we might call it OraLabel, not just Label, so that we could still use the Athena Label widget in the same application.
[111] This appendix is based on a comp.windows.x network news posting by Gene Dykes of Cornell University.