Every widget class that wants to take part in the BaseClass game of hooks and wrappers must attach a data structure of type XmBaseClassExtRec to its class record. From now on I'll use the abbreviation ``BCE record'' (although its more an acronym) whenever I refer to a data structure of the type XmBaseClassExtRec. A BCE record can be used to add prehook and posthook methods to any widget class. Beside this, a BCE record also contains information about secondary objects, wrapper methods and other things right out of Pandora's box.
The layout of a BCE record is as follows:
XmBaseClassExtRec
typedef struct _XmBaseClassExtRec { XtPointer next_extension; XrmQuark record_type; long version; Cardinal record_size; XtInitProc initializePrehook; XtSetValuesFunc setValuesPrehook; XtInitProc initializePosthook; XtSetValuesFunc setValuesPosthook; WidgetClass secondaryObjectClass; XtInitProc secondaryObjectCreate; XmGetSecResDataFunc getSecResData; unsigned char flags[32]; XtArgsProc getValuesPrehook; XtArgsProc getValuesPosthook; XtWidgetClassProc classPartInitPrehook; XtWidgetClassProc classPartInitPosthook; XtResourceList ext_resources; XtResourceList compiled_ext_resources; Cardinal num_ext_resources; Boolean use_sub_resources; XmWidgetNavigableProc widgetNavigable; XmFocusChangeProc focusChange; XmWrapperData wrapperData; } XmBaseClassExtRec, *XmBaseClassExt;
If you want to attach your own BCE record to a (may be self-written) M*TIF widget class, take these steps:
If you don't need the BaseClass' whistles and bells for your self-written new widget class and you subclass from any of M*TIF's widget classes, then you can skip the steps mentioned above. If you don't attach a BCE record to your widget class record you'll automagically inherit a BCE record from your widget's superclass.
Now let's look at each member of a BCE record in more detail: