This guide tells you how to subclass a Motif widget from XmPrimitive or XmManager. This guide does not explain how to write a gadget or a shell widget. Furthermore, this guide does not explain how to subclass directly from the Athena widget set or from any other widget set.
Subclassing from XmPrimitive or XmManager will allow your widget to call existing methods that provide much of the appropriate Motif look and feel.