--- /dev/null
+#include "extcdef.h"
+
+/*************************************************************************
+
+ main
+
+*************************************************************************/
+
+pascal SInt32 main(SInt16 varCode , ControlHandle theControl , ControlDefProcMessage message, SInt32 param )
+{
+ long returnValue = 0L;
+ char state = HGetState((Handle)theControl);
+
+ if ( message != initCntl )
+ {
+ ExtCDEFInfo* info = (ExtCDEFInfo* ) (**theControl).contrlRfCon ;
+ if ( info )
+ {
+ returnValue = info->defProc( info->procID, theControl, message, param) ;
+ }
+ }
+ else
+ {
+ (**theControl).contrlRfCon = NULL ;
+ }
+ HSetState((Handle)theControl,state);
+
+ return(returnValue); /* tell them what happened */
+}
--- /dev/null
+#pragma once
+
+#include <stdlib.h>
+
+#define kExtCDEFID 128 // resource id of our CDEF resource <Controls.h>
+const long kExtCDEFMagic = 0xFEEDFEED ;
+typedef struct ExtCDEFInfo
+{
+ ControlDefProcPtr defProc ; // this must always be the lowest element
+ long magic ;
+ long contrlRfCon ;
+ ControlHandle containerControl ;
+ Handle children ;
+ ControlFontStyleRec fontStyle ;
+ Boolean hasFocus ;
+ SInt16 procID ;
+ long privateData ;
+} ExtCDEFInfo ;
+
+void NewExtCDEFInfo( ControlHandle theControl , ControlDefProcPtr defproc , SInt16 procID , long refcon ) ;
+void DisposeExtCDEFInfo( ControlHandle theControl) ;