Index: ChangeLog
===================================================================
RCS file: /home/cvs/external/tk/ChangeLog,v
retrieving revision 1.240
diff -c -r1.240 ChangeLog
*** ChangeLog	2000/11/02 02:19:57	1.240
--- ChangeLog	2000/11/02 02:45:36
***************
*** 1,3 ****
--- 1,75 ----
+ 2000-11-01  Eric Melski  <ericm@ajubasolutions.com>
+ 
+ 	Overall change:  Implemented TIP 5, which exports
+ 	TkClassProcs/TkSetClassProcs as Tk_ClassProcs/Tk_SetClassProcs,
+ 	adding a size field to Tk_ClassProcs to allow for future
+ 	expansion, and renaming the geometryProc to worldChangedProc,
+ 	which is more in keeping with the actual use of the callback.
+ 
+ 	* unix/mkLinks: Added link for Tk_SetClassProcs.
+ 
+ 	* doc/SetClassProcs.3: Documentation for
+ 	Tk_ClassProcs/Tk_SetClassProcs.
+ 
+ 	* generic/tkCanvas.c:
+ 	* generic/tkEntry.c:
+ 	* generic/tkFrame.c:
+ 	* generic/tkListbox.c:
+ 	* generic/tkMenu.c:
+ 	* generic/tkMessage.c:
+ 	* generic/tkScale.c:
+ 	* generic/tkText.c: Updated to use Tk_ClassProcs/Tk_SetClassProcs
+ 	instead of TkClassProcs/TkSetClassProcs.
+ 
+ 	* generic/tkMenubutton.c:
+ 	* generic/tkScrollbar.c:
+ 	* generic/tkButton.c: Updated to use Tk_SetClassProcs instead of
+ 	TkSetClassProcs.
+ 
+ 	* generic/tkMenubutton.h:
+ 	* generic/tkScrollbar.h:
+ 	* generic/tkButton.h:
+ 	* win/tkWinButton.c:
+ 	* win/tkWinScrlbr.c:
+ 	* mac/tkMacButton.c:
+ 	* mac/tkMacMenubutton.c:
+ 	* mac/tkMacScrlbr.c:
+ 	* unix/tkUnixButton.c:
+ 	* unix/tkUnixMenubu.c:
+ 	* unix/tkUnixScrlbr.c: Updated to use Tk_ClassProcs instead of
+ 	TkClassProcs.
+ 
+ 	* generic/tkDecls.h:
+ 	* generic/tkStubInit.c:
+ 	* generic/tkIntDecls.h: Regenned from tk.decls, tkInt.decls.
+ 	
+ 	* generic/tk.h: Added declaration of Tk_ClassProcs, with size
+ 	field.  Added typedef's for Tk_ClassCreateProc,
+ 	Tk_ClassWorldChangedProc, Tk_ClassModalProc.  Added definition of
+ 	Tk_GetClassProc macro, shorthand for extracting a member of the
+ 	Tk_ClassProcs structure.
+ 
+ 	* generic/tkInt.h: Removed declaration of TkClassProcs,
+ 	TkClassGeometryProc, etc.
+ 
+ 	* generic/tkBind.c (Tk_BindEvent): Updated to use Tk_GetClassProc
+ 	macro to extract modalProc; added check that the modalProc is non-NULL.
+ 
+ 	* generic/tkFont.c (RecomputeWidgets): Updated to use
+ 	Tk_GetClassProc macro to extract worldChangedProc; added comment
+ 	about the choice of a recursive versus iterative algorithm for
+ 	propagating world changed messages.
+ 
+ 	* generic/tkWindow.c (Tk_MakeWindowExist): Updated to use
+ 	Tk_GetClassProc macro to extract createProc from Tk_ClassProcs.
+ 
+ 	* generic/tk.decls: Added declaration for Tk_SetClassProcs.
+ 
+ 	* generic/tkInt.decls: Commented out declaration for
+ 	TkSetClassProcs, which is made public by this change.  The entry
+ 	is left in place, but commented, so that future developers will
+ 	know not to reuse it's stub number.
+ 
  2000-11-01  Jeff Hobbs  <hobbs@ajubasolutions.com>
  
  	* win/tkWinDialog.c (GetFileNameW, GetFileNameA,
Index: generic/tk.decls
===================================================================
RCS file: /home/cvs/external/tk/generic/tk.decls,v
retrieving revision 1.13
diff -c -r1.13 tk.decls
*** generic/tk.decls	2000/10/21 21:22:42	1.13
--- generic/tk.decls	2000/11/02 02:45:36
***************
*** 1142,1148 ****
      Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp, \
  	    Tk_Window parent, char *screenName)
  }
! 
  
  # Define the platform specific public Tk interface.  These functions are
  # only available on the designated platform.
--- 1142,1151 ----
      Tk_Window Tk_CreateAnonymousWindow (Tcl_Interp *interp, \
  	    Tk_Window parent, char *screenName)
  }
! declare 242 generic {
!     void Tk_SetClassProcs (Tk_Window tkwin, \
! 	    Tk_ClassProcs *procs, ClientData instanceData)
! }
  
  # Define the platform specific public Tk interface.  These functions are
  # only available on the designated platform.
Index: generic/tk.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tk.h,v
retrieving revision 1.52
diff -c -r1.52 tk.h
*** generic/tk.h	2000/10/05 18:31:25	1.52
--- generic/tk.h	2000/11/02 02:45:36
***************
*** 548,553 ****
--- 548,598 ----
  #define TK_IGNORE_NEWLINES	16
  
  /*
+  * Widget class procedures used to implement platform specific widget
+  * behavior.
+  */
+ 
+ typedef Window (Tk_ClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin,
+ 	Window parent, ClientData instanceData));
+ typedef void (Tk_ClassWorldChangedProc) _ANSI_ARGS_((ClientData instanceData));
+ typedef void (Tk_ClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
+ 	XEvent *eventPtr));
+ 
+ typedef struct Tk_ClassProcs {
+     unsigned int size;
+     Tk_ClassWorldChangedProc *worldChangedProc;
+ 				/* Procedure to invoke when the widget needs to
+ 				 * respond in some way to a change in the
+ 				 * world (font changes, etc.) */
+     Tk_ClassCreateProc *createProc;
+ 				/* Procedure to invoke when the
+ 				 * platform-dependent window needs to be
+                                  * created. */
+     Tk_ClassModalProc *modalProc;
+ 				/* Procedure to invoke after all bindings on a
+ 				 * widget have been triggered in order to
+ 				 * handle a modal loop. */
+ } Tk_ClassProcs;
+ 
+ /*
+  * Simple accessor for Tk_ClassProcs structure.  Checks that the structure
+  * is not NULL, then checks the size field and returns either the requested
+  * field, if present, or NULL if the structure is too small to have the field
+  * (or NULL if the structure is NULL).
+  *
+  * A more general version of this function may be useful if other
+  * size-versioned structure pop up in the future:
+  *
+  *	#define Tk_GetField(name, who, which) \
+  *	    (((who) == NULL) ? NULL :
+  *	    (((who)->size <= Tk_Offset(name, which)) ? NULL :(name)->which))
+  */
+ 
+ #define Tk_GetClassProc(procs, which) \
+     (((procs) == NULL) ? NULL : \
+     (((procs)->size <= Tk_Offset(Tk_ClassProcs, which)) ? NULL:(procs)->which))
+ 
+ /*
   * Each geometry manager (the packer, the placer, etc.) is represented
   * by a structure of the following form, which indicates procedures
   * to invoke in the geometry manager to carry out certain functions.
Index: generic/tkBind.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkBind.c,v
retrieving revision 1.13
diff -c -r1.13 tkBind.c
*** generic/tkBind.c	2000/04/19 01:06:50	1.13
--- generic/tkBind.c	2000/11/02 02:45:36
***************
*** 1426,1432 ****
      PendingBinding staticPending;
      TkWindow *winPtr = (TkWindow *)tkwin;
      PatternTableKey key;
! 
      /*
       * Ignore events on windows that don't have names: these are windows
       * like wrapper windows that shouldn't be visible to the
--- 1426,1432 ----
      PendingBinding staticPending;
      TkWindow *winPtr = (TkWindow *)tkwin;
      PatternTableKey key;
!     Tk_ClassModalProc *modalProc;
      /*
       * Ignore events on windows that don't have names: these are windows
       * like wrapper windows that shouldn't be visible to the
***************
*** 1805,1811 ****
  	winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL) 
  	    | (flags & TK_DEFER_MODAL);
  	if (deferModal) {
! 	    (*winPtr->classProcsPtr->modalProc)(tkwin, eventPtr);
  	}
      }
  
--- 1805,1814 ----
  	winPtr->flags = (winPtr->flags & (unsigned int) ~TK_DEFER_MODAL) 
  	    | (flags & TK_DEFER_MODAL);
  	if (deferModal) {
! 	    modalProc = Tk_GetClassProc(winPtr->classProcsPtr, modalProc);
! 	    if (modalProc != NULL) {
! 		(*modalProc)(tkwin, eventPtr);
! 	    }
  	}
      }
  
Index: generic/tkButton.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkButton.c,v
retrieving revision 1.11
diff -c -r1.11 tkButton.c
*** generic/tkButton.c	2000/10/01 21:35:27	1.11
--- generic/tkButton.c	2000/11/02 02:45:36
***************
*** 658,664 ****
      Tk_SetClass(tkwin, classNames[type]);
      butPtr = TkpCreateButton(tkwin);
  
!     TkSetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr);
  
      /*
       * Initialize the data structure for the button.
--- 658,664 ----
      Tk_SetClass(tkwin, classNames[type]);
      butPtr = TkpCreateButton(tkwin);
  
!     Tk_SetClassProcs(tkwin, &tkpButtonProcs, (ClientData) butPtr);
  
      /*
       * Initialize the data structure for the button.
Index: generic/tkButton.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkButton.h,v
retrieving revision 1.7
diff -c -r1.7 tkButton.h
*** generic/tkButton.h	2000/05/17 21:17:20	1.7
--- generic/tkButton.h	2000/11/02 02:45:36
***************
*** 287,293 ****
   * Declaration of variables shared between the files in the button module.
   */
  
! extern TkClassProcs tkpButtonProcs;
  
  /*
   * Declaration of procedures used in the implementation of the button
--- 287,293 ----
   * Declaration of variables shared between the files in the button module.
   */
  
! extern Tk_ClassProcs tkpButtonProcs;
  
  /*
   * Declaration of procedures used in the implementation of the button
Index: generic/tkCanvas.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkCanvas.c,v
retrieving revision 1.14
diff -c -r1.14 tkCanvas.c
*** generic/tkCanvas.c	2000/04/14 08:33:15	1.14
--- generic/tkCanvas.c	2000/11/02 02:45:36
***************
*** 330,339 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs canvasClass = {
!     NULL,			/* createProc. */
!     CanvasWorldChanged,		/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 330,338 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs canvasClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     CanvasWorldChanged,		/* worldChangedProc */
  };
  
  
***************
*** 467,473 ****
      Tcl_InitHashTable(&canvasPtr->idTable, TCL_ONE_WORD_KEYS);
  
      Tk_SetClass(canvasPtr->tkwin, "Canvas");
!     TkSetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr);
      Tk_CreateEventHandler(canvasPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    CanvasEventProc, (ClientData) canvasPtr);
--- 466,472 ----
      Tcl_InitHashTable(&canvasPtr->idTable, TCL_ONE_WORD_KEYS);
  
      Tk_SetClass(canvasPtr->tkwin, "Canvas");
!     Tk_SetClassProcs(canvasPtr->tkwin, &canvasClass, (ClientData) canvasPtr);
      Tk_CreateEventHandler(canvasPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    CanvasEventProc, (ClientData) canvasPtr);
Index: generic/tkDecls.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkDecls.h,v
retrieving revision 1.13
diff -c -r1.13 tkDecls.h
*** generic/tkDecls.h	2000/10/05 18:31:25	1.13
--- generic/tkDecls.h	2000/11/02 02:45:36
***************
*** 830,835 ****
--- 830,839 ----
  EXTERN Tk_Window	Tk_CreateAnonymousWindow _ANSI_ARGS_((
  				Tcl_Interp * interp, Tk_Window parent, 
  				char * screenName));
+ /* 242 */
+ EXTERN void		Tk_SetClassProcs _ANSI_ARGS_((Tk_Window tkwin, 
+ 				Tk_ClassProcs * procs, 
+ 				ClientData instanceData));
  
  typedef struct TkStubHooks {
      struct TkPlatStubs *tkPlatStubs;
***************
*** 1084,1089 ****
--- 1088,1094 ----
      void (*tk_CreateClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 239 */
      void (*tk_DeleteClientMessageHandler) _ANSI_ARGS_((Tk_ClientMessageProc * proc)); /* 240 */
      Tk_Window (*tk_CreateAnonymousWindow) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window parent, char * screenName)); /* 241 */
+     void (*tk_SetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, Tk_ClassProcs * procs, ClientData instanceData)); /* 242 */
  } TkStubs;
  
  #ifdef __cplusplus
***************
*** 2061,2066 ****
--- 2066,2075 ----
  #ifndef Tk_CreateAnonymousWindow
  #define Tk_CreateAnonymousWindow \
  	(tkStubsPtr->tk_CreateAnonymousWindow) /* 241 */
+ #endif
+ #ifndef Tk_SetClassProcs
+ #define Tk_SetClassProcs \
+ 	(tkStubsPtr->tk_SetClassProcs) /* 242 */
  #endif
  
  #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
Index: generic/tkEntry.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkEntry.c,v
retrieving revision 1.17
diff -c -r1.17 tkEntry.c
*** generic/tkEntry.c	2000/05/29 01:43:14	1.17
--- generic/tkEntry.c	2000/11/02 02:45:36
***************
*** 736,745 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs entryClass = {
!     NULL,			/* createProc. */
!     EntryWorldChanged,		/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 736,744 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs entryClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     EntryWorldChanged,		/* worldChangedProc */
  };
  
  
***************
*** 839,845 ****
      entryPtr->validate		= VALIDATE_NONE;
  
      Tk_SetClass(entryPtr->tkwin, "Entry");
!     TkSetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
      Tk_CreateEventHandler(entryPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    EntryEventProc, (ClientData) entryPtr);
--- 838,844 ----
      entryPtr->validate		= VALIDATE_NONE;
  
      Tk_SetClass(entryPtr->tkwin, "Entry");
!     Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
      Tk_CreateEventHandler(entryPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    EntryEventProc, (ClientData) entryPtr);
***************
*** 3740,3746 ****
      sbPtr->buRelief		= TK_RELIEF_FLAT;
  
      Tk_SetClass(entryPtr->tkwin, "Spinbox");
!     TkSetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
      Tk_CreateEventHandler(entryPtr->tkwin,
  	    PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    EntryEventProc, (ClientData) entryPtr);
--- 3739,3745 ----
      sbPtr->buRelief		= TK_RELIEF_FLAT;
  
      Tk_SetClass(entryPtr->tkwin, "Spinbox");
!     Tk_SetClassProcs(entryPtr->tkwin, &entryClass, (ClientData) entryPtr);
      Tk_CreateEventHandler(entryPtr->tkwin,
  	    PointerMotionMask|ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    EntryEventProc, (ClientData) entryPtr);
Index: generic/tkFont.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkFont.c,v
retrieving revision 1.10
diff -c -r1.10 tkFont.c
*** generic/tkFont.c	2000/02/03 21:27:26	1.10
--- generic/tkFont.c	2000/11/02 02:45:36
***************
*** 831,840 ****
  RecomputeWidgets(winPtr)
      TkWindow *winPtr;		/* Window to which command is sent. */
  {
!     if ((winPtr->classProcsPtr != NULL)
! 	    && (winPtr->classProcsPtr->geometryProc != NULL)) {
! 	(*winPtr->classProcsPtr->geometryProc)(winPtr->instanceData);
      }
      for (winPtr = winPtr->childList; winPtr != NULL; winPtr = winPtr->nextPtr) {
  	RecomputeWidgets(winPtr);
      }
--- 831,860 ----
  RecomputeWidgets(winPtr)
      TkWindow *winPtr;		/* Window to which command is sent. */
  {
!     Tk_ClassWorldChangedProc *proc;
!     proc = Tk_GetClassProc(winPtr->classProcsPtr, worldChangedProc);
!     if (proc != NULL) {
! 	(*proc)(winPtr->instanceData);
      }
+ 
+     /*
+      * Notify all the descendants of this window that the world has changed.
+      *
+      * This could be done recursively or iteratively.  The recursive version
+      * is easier to implement and understand, and typically, windows with a
+      * -font option will be leaf nodes in the widget heirarchy (buttons,
+      * labels, etc.), so the recursion depth will be shallow.
+      *
+      * However, the additional overhead of the recursive calls may become
+      * a performance problem if typical usage alters such that -font'ed widgets
+      * appear high in the heirarchy, causing deep recursion.  This could happen
+      * with text widgets, or more likely with the (not yet existant) labeled
+      * frame widget.  With these widgets it is possible, even likely, that a
+      * -font'ed widget (text or labeled frame) will not be a leaf node, but
+      * will instead have many descendants.  If this is ever found to cause
+      * a performance problem, it may be worth investigating an iterative
+      * version of the code below.
+      */
      for (winPtr = winPtr->childList; winPtr != NULL; winPtr = winPtr->nextPtr) {
  	RecomputeWidgets(winPtr);
      }
Index: generic/tkFrame.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkFrame.c,v
retrieving revision 1.6
diff -c -r1.6 tkFrame.c
*** generic/tkFrame.c	2000/02/10 08:52:32	1.6
--- generic/tkFrame.c	2000/11/02 02:45:36
***************
*** 451,457 ****
      /*
       * Store backreference to frame widget in window structure.
       */
!     TkSetClassProcs(new, NULL, (ClientData) framePtr);
  
      mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
      if (toplevel) {
--- 451,457 ----
      /*
       * Store backreference to frame widget in window structure.
       */
!     Tk_SetClassProcs(new, NULL, (ClientData) framePtr);
  
      mask = ExposureMask | StructureNotifyMask | FocusChangeMask;
      if (toplevel) {
Index: generic/tkInt.decls
===================================================================
RCS file: /home/cvs/external/tk/generic/tkInt.decls,v
retrieving revision 1.17
diff -c -r1.17 tkInt.decls
*** generic/tkInt.decls	2000/04/10 22:43:11	1.17
--- generic/tkInt.decls	2000/11/02 02:45:36
***************
*** 396,405 ****
      void TkSelPropProc (XEvent *eventPtr)
  }
  
! declare 84 generic {
!     void TkSetClassProcs (Tk_Window tkwin, \
! 	    TkClassProcs *procs, ClientData instanceData)
! }
  
  declare 85 generic {
      void TkSetWindowMenuBar (Tcl_Interp *interp, \
--- 396,406 ----
      void TkSelPropProc (XEvent *eventPtr)
  }
  
! # Exported publically as Tk_SetClassProcs in 8.4a2
! #declare 84 generic {
! #    void TkSetClassProcs (Tk_Window tkwin, \
! #	    TkClassProcs *procs, ClientData instanceData)
! #}
  
  declare 85 generic {
      void TkSetWindowMenuBar (Tcl_Interp *interp, \
Index: generic/tkInt.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkInt.h,v
retrieving revision 1.33
diff -c -r1.33 tkInt.h
*** generic/tkInt.h	2000/08/08 19:21:19	1.33
--- generic/tkInt.h	2000/11/02 02:45:36
***************
*** 46,79 ****
  	Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
  	KeySym keySym));
  typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));
- typedef Window (TkClassCreateProc) _ANSI_ARGS_((Tk_Window tkwin,
- 	Window parent, ClientData instanceData));
- typedef void (TkClassGeometryProc) _ANSI_ARGS_((ClientData instanceData));
- typedef void (TkClassModalProc) _ANSI_ARGS_((Tk_Window tkwin,
- 	XEvent *eventPtr));
- 
  
  /*
-  * Widget class procedures used to implement platform specific widget
-  * behavior.
-  */
- 
- typedef struct TkClassProcs {
-     TkClassCreateProc *createProc;
- 				/* Procedure to invoke when the
-                                    platform-dependent window needs to be
-                                    created. */
-     TkClassGeometryProc *geometryProc;
- 				/* Procedure to invoke when the geometry of a
- 				   window needs to be recalculated as a result
- 				   of some change in the system. */
-     TkClassModalProc *modalProc;
- 				/* Procedure to invoke after all bindings on a
- 				   widget have been triggered in order to
- 				   handle a modal loop. */
- } TkClassProcs;
- 
- /*
   * One of the following structures is maintained for each cursor in
   * use in the system.  This structure is used by tkCursor.c and the
   * various system specific cursor files.
--- 46,53 ----
***************
*** 782,788 ****
       * Information used by widget classes.
       */
  
!     TkClassProcs *classProcsPtr;
      ClientData instanceData;
  
      /*
--- 756,762 ----
       * Information used by widget classes.
       */
  
!     Tk_ClassProcs *classProcsPtr;
      ClientData instanceData;
  
      /*
Index: generic/tkIntDecls.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkIntDecls.h,v
retrieving revision 1.10
diff -c -r1.10 tkIntDecls.h
*** generic/tkIntDecls.h	2000/04/10 22:43:12	1.10
--- generic/tkIntDecls.h	2000/11/02 02:45:36
***************
*** 289,298 ****
  EXTERN void		TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
  /* 83 */
  EXTERN void		TkSelPropProc _ANSI_ARGS_((XEvent * eventPtr));
! /* 84 */
! EXTERN void		TkSetClassProcs _ANSI_ARGS_((Tk_Window tkwin, 
! 				TkClassProcs * procs, 
! 				ClientData instanceData));
  /* 85 */
  EXTERN void		TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp * interp, 
  				Tk_Window tkwin, char * oldMenuName, 
--- 289,295 ----
  EXTERN void		TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
  /* 83 */
  EXTERN void		TkSelPropProc _ANSI_ARGS_((XEvent * eventPtr));
! /* Slot 84 is reserved */
  /* 85 */
  EXTERN void		TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp * interp, 
  				Tk_Window tkwin, char * oldMenuName, 
***************
*** 603,609 ****
      void (*tkSelEventProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent * eventPtr)); /* 81 */
      void (*tkSelInit) _ANSI_ARGS_((Tk_Window tkwin)); /* 82 */
      void (*tkSelPropProc) _ANSI_ARGS_((XEvent * eventPtr)); /* 83 */
!     void (*tkSetClassProcs) _ANSI_ARGS_((Tk_Window tkwin, TkClassProcs * procs, ClientData instanceData)); /* 84 */
      void (*tkSetWindowMenuBar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, char * menuName)); /* 85 */
      KeySym (*tkStringToKeysym) _ANSI_ARGS_((char * name)); /* 86 */
      int (*tkThickPolyLineToArea) _ANSI_ARGS_((double * coordPtr, int numPoints, double width, int capStyle, int joinStyle, double * rectPtr)); /* 87 */
--- 600,606 ----
      void (*tkSelEventProc) _ANSI_ARGS_((Tk_Window tkwin, XEvent * eventPtr)); /* 81 */
      void (*tkSelInit) _ANSI_ARGS_((Tk_Window tkwin)); /* 82 */
      void (*tkSelPropProc) _ANSI_ARGS_((XEvent * eventPtr)); /* 83 */
!     void *reserved84;
      void (*tkSetWindowMenuBar) _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin, char * oldMenuName, char * menuName)); /* 85 */
      KeySym (*tkStringToKeysym) _ANSI_ARGS_((char * name)); /* 86 */
      int (*tkThickPolyLineToArea) _ANSI_ARGS_((double * coordPtr, int numPoints, double width, int capStyle, int joinStyle, double * rectPtr)); /* 87 */
***************
*** 1171,1180 ****
  #define TkSelPropProc \
  	(tkIntStubsPtr->tkSelPropProc) /* 83 */
  #endif
! #ifndef TkSetClassProcs
! #define TkSetClassProcs \
! 	(tkIntStubsPtr->tkSetClassProcs) /* 84 */
! #endif
  #ifndef TkSetWindowMenuBar
  #define TkSetWindowMenuBar \
  	(tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
--- 1168,1174 ----
  #define TkSelPropProc \
  	(tkIntStubsPtr->tkSelPropProc) /* 83 */
  #endif
! /* Slot 84 is reserved */
  #ifndef TkSetWindowMenuBar
  #define TkSetWindowMenuBar \
  	(tkIntStubsPtr->tkSetWindowMenuBar) /* 85 */
Index: generic/tkListbox.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkListbox.c,v
retrieving revision 1.18
diff -c -r1.18 tkListbox.c
*** generic/tkListbox.c	2000/07/28 16:41:40	1.18
--- generic/tkListbox.c	2000/11/02 02:45:36
***************
*** 434,443 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs listboxClass = {
!     NULL,			/* createProc. */
!     ListboxWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 434,442 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs listboxClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     ListboxWorldChanged,	/* worldChangedProc */
  };
  
  
***************
*** 576,582 ****
      listPtr->flags 			= 0;
  
      Tk_SetClass(listPtr->tkwin, "Listbox");
!     TkSetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr);
      Tk_CreateEventHandler(listPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    ListboxEventProc, (ClientData) listPtr);
--- 575,581 ----
      listPtr->flags 			= 0;
  
      Tk_SetClass(listPtr->tkwin, "Listbox");
!     Tk_SetClassProcs(listPtr->tkwin, &listboxClass, (ClientData) listPtr);
      Tk_CreateEventHandler(listPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    ListboxEventProc, (ClientData) listPtr);
Index: generic/tkMenu.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkMenu.c,v
retrieving revision 1.8
diff -c -r1.8 tkMenu.c
*** generic/tkMenu.c	2000/08/03 20:36:16	1.8
--- generic/tkMenu.c	2000/11/02 02:45:36
***************
*** 363,377 ****
   * the geometry proc to be called.
   */
  
! static TkClassProcs menuClass = {
!     NULL,			/* createProc. */
!     MenuWorldChanged		/* geometryProc. */
  };
  
  /*
   *--------------------------------------------------------------
   *
!  * Tk_CreateMenuCmd --
   *
   *	Called by Tk at initialization time to create the menu
   *	command.
--- 363,377 ----
   * the geometry proc to be called.
   */
  
! static Tk_ClassProcs menuClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     MenuWorldChanged		/* worldChangedProc */
  };
  
  /*
   *--------------------------------------------------------------
   *
!  * TkCreateMenuCmd --
   *
   *	Called by Tk at initialization time to create the menu
   *	command.
***************
*** 523,529 ****
      TkMenuInitializeDrawingFields(menuPtr);
  
      Tk_SetClass(menuPtr->tkwin, "Menu");
!     TkSetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
      if (Tk_InitOptions(interp, (char *) menuPtr,
  	    menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin)
  	    != TCL_OK) {
--- 523,529 ----
      TkMenuInitializeDrawingFields(menuPtr);
  
      Tk_SetClass(menuPtr->tkwin, "Menu");
!     Tk_SetClassProcs(menuPtr->tkwin, &menuClass, (ClientData) menuPtr);
      if (Tk_InitOptions(interp, (char *) menuPtr,
  	    menuPtr->optionTablesPtr->menuOptionTable, menuPtr->tkwin)
  	    != TCL_OK) {
Index: generic/tkMenubutton.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkMenubutton.c,v
retrieving revision 1.4
diff -c -r1.4 tkMenubutton.c
*** generic/tkMenubutton.c	1999/04/24 01:50:49	1.4
--- generic/tkMenubutton.c	2000/11/02 02:45:36
***************
*** 240,246 ****
      Tk_SetClass(tkwin, "Menubutton");
      mbPtr = TkpCreateMenuButton(tkwin);
  
!     TkSetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr);
  
      /*
       * Initialize the data structure for the button.
--- 240,246 ----
      Tk_SetClass(tkwin, "Menubutton");
      mbPtr = TkpCreateMenuButton(tkwin);
  
!     Tk_SetClassProcs(tkwin, &tkpMenubuttonClass, (ClientData) mbPtr);
  
      /*
       * Initialize the data structure for the button.
Index: generic/tkMenubutton.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkMenubutton.h,v
retrieving revision 1.5
diff -c -r1.5 tkMenubutton.h
*** generic/tkMenubutton.h	1999/04/16 01:51:19	1.5
--- generic/tkMenubutton.h	2000/11/02 02:45:36
***************
*** 211,217 ****
   * Declaration of variables shared between the files in the button module.
   */
  
! extern TkClassProcs tkpMenubuttonClass;
  
  /*
   * Declaration of procedures used in the implementation of the button
--- 211,217 ----
   * Declaration of variables shared between the files in the button module.
   */
  
! extern Tk_ClassProcs tkpMenubuttonClass;
  
  /*
   * Declaration of procedures used in the implementation of the button
Index: generic/tkMessage.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkMessage.c,v
retrieving revision 1.8
diff -c -r1.8 tkMessage.c
*** generic/tkMessage.c	2000/09/06 19:02:01	1.8
--- generic/tkMessage.c	2000/11/02 02:45:36
***************
*** 195,211 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs messageClass = {
!     NULL,			/* createProc. */
!     MessageWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
  /*
   *--------------------------------------------------------------
   *
!  * Tk_MessageCmd --
   *
   *	This procedure is invoked to process the "message" Tcl
   *	command.  See the user documentation for details on what
--- 195,210 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs messageClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     MessageWorldChanged,	/* worldChangedProc */
  };
  
  
  /*
   *--------------------------------------------------------------
   *
!  * Tk_MessageObjCmd --
   *
   *	This procedure is invoked to process the "message" Tcl
   *	command.  See the user documentation for details on what
***************
*** 282,288 ****
      msgPtr->cursor		= None;
  
      Tk_SetClass(msgPtr->tkwin, "Message");
!     TkSetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
      Tk_CreateEventHandler(msgPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    MessageEventProc, (ClientData) msgPtr);
--- 281,287 ----
      msgPtr->cursor		= None;
  
      Tk_SetClass(msgPtr->tkwin, "Message");
!     Tk_SetClassProcs(msgPtr->tkwin, &messageClass, (ClientData) msgPtr);
      Tk_CreateEventHandler(msgPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    MessageEventProc, (ClientData) msgPtr);
Index: generic/tkScale.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkScale.c,v
retrieving revision 1.12
diff -c -r1.12 tkScale.c
*** generic/tkScale.c	2000/04/14 08:33:16	1.12
--- generic/tkScale.c	2000/11/02 02:45:36
***************
*** 185,194 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs scaleClass = {
!     NULL,			/* createProc. */
!     ScaleWorldChanged,		/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 185,193 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs scaleClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     ScaleWorldChanged,		/* worldChangedProc */
  };
  
  
***************
*** 314,320 ****
      scalePtr->takeFocusPtr	= NULL;
      scalePtr->flags		= NEVER_SET;
  
!     TkSetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr);
      Tk_CreateEventHandler(scalePtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    ScaleEventProc, (ClientData) scalePtr);
--- 313,319 ----
      scalePtr->takeFocusPtr	= NULL;
      scalePtr->flags		= NEVER_SET;
  
!     Tk_SetClassProcs(scalePtr->tkwin, &scaleClass, (ClientData) scalePtr);
      Tk_CreateEventHandler(scalePtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    ScaleEventProc, (ClientData) scalePtr);
Index: generic/tkScrollbar.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkScrollbar.c,v
retrieving revision 1.4
diff -c -r1.4 tkScrollbar.c
*** generic/tkScrollbar.c	1999/12/14 06:52:30	1.4
--- generic/tkScrollbar.c	2000/11/02 02:45:36
***************
*** 153,159 ****
      Tk_SetClass(new, "Scrollbar");
      scrollPtr = TkpCreateScrollbar(new);
  
!     TkSetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr);
  
      /*
       * Initialize fields that won't be initialized by ConfigureScrollbar,
--- 153,159 ----
      Tk_SetClass(new, "Scrollbar");
      scrollPtr = TkpCreateScrollbar(new);
  
!     Tk_SetClassProcs(new, &tkpScrollbarProcs, (ClientData) scrollPtr);
  
      /*
       * Initialize fields that won't be initialized by ConfigureScrollbar,
Index: generic/tkScrollbar.h
===================================================================
RCS file: /home/cvs/external/tk/generic/tkScrollbar.h,v
retrieving revision 1.5
diff -c -r1.5 tkScrollbar.h
*** generic/tkScrollbar.h	1999/12/14 06:52:30	1.5
--- generic/tkScrollbar.h	2000/11/02 02:45:36
***************
*** 171,177 ****
   * Declaration of scrollbar class procedures structure.
   */
  
! extern TkClassProcs tkpScrollbarProcs;
  
  /*
   * Declaration of scrollbar configuration options.
--- 171,177 ----
   * Declaration of scrollbar class procedures structure.
   */
  
! extern Tk_ClassProcs tkpScrollbarProcs;
  
  /*
   * Declaration of scrollbar configuration options.
Index: generic/tkStubInit.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkStubInit.c,v
retrieving revision 1.24
diff -c -r1.24 tkStubInit.c
*** generic/tkStubInit.c	2000/10/05 18:31:26	1.24
--- generic/tkStubInit.c	2000/11/02 02:45:36
***************
*** 131,137 ****
      TkSelEventProc, /* 81 */
      TkSelInit, /* 82 */
      TkSelPropProc, /* 83 */
!     TkSetClassProcs, /* 84 */
      TkSetWindowMenuBar, /* 85 */
      TkStringToKeysym, /* 86 */
      TkThickPolyLineToArea, /* 87 */
--- 131,137 ----
      TkSelEventProc, /* 81 */
      TkSelInit, /* 82 */
      TkSelPropProc, /* 83 */
!     NULL, /* 84 */
      TkSetWindowMenuBar, /* 85 */
      TkStringToKeysym, /* 86 */
      TkThickPolyLineToArea, /* 87 */
***************
*** 952,957 ****
--- 952,958 ----
      Tk_CreateClientMessageHandler, /* 239 */
      Tk_DeleteClientMessageHandler, /* 240 */
      Tk_CreateAnonymousWindow, /* 241 */
+     Tk_SetClassProcs, /* 242 */
  };
  
  /* !END!: Do not edit above this line. */
Index: generic/tkText.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkText.c,v
retrieving revision 1.17
diff -c -r1.17 tkText.c
*** generic/tkText.c	2000/07/25 00:05:40	1.17
--- generic/tkText.c	2000/11/02 02:45:36
***************
*** 310,319 ****
   * that can be invoked from generic window code.
   */
  
! static TkClassProcs textClass = {
!     NULL,			/* createProc. */
!     TextWorldChanged,		/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 310,318 ----
   * that can be invoked from generic window code.
   */
  
! static Tk_ClassProcs textClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     TextWorldChanged,		/* worldChangedProc */
  };
  
  
***************
*** 440,446 ****
      textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex);
  
      Tk_SetClass(textPtr->tkwin, "Text");
!     TkSetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr);
      Tk_CreateEventHandler(textPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    TextEventProc, (ClientData) textPtr);
--- 439,445 ----
      textPtr->insertMarkPtr = TkTextSetMark(textPtr, "insert", &startIndex);
  
      Tk_SetClass(textPtr->tkwin, "Text");
!     Tk_SetClassProcs(textPtr->tkwin, &textClass, (ClientData) textPtr);
      Tk_CreateEventHandler(textPtr->tkwin,
  	    ExposureMask|StructureNotifyMask|FocusChangeMask,
  	    TextEventProc, (ClientData) textPtr);
Index: generic/tkWindow.c
===================================================================
RCS file: /home/cvs/external/tk/generic/tkWindow.c,v
retrieving revision 1.26
diff -c -r1.26 tkWindow.c
*** generic/tkWindow.c	2000/10/05 18:31:26	1.26
--- generic/tkWindow.c	2000/11/02 02:45:36
***************
*** 1578,1583 ****
--- 1578,1584 ----
      TkWindow *winPtr2;
      Window parent;
      Tcl_HashEntry *hPtr;
+     Tk_ClassCreateProc *createProc;
      int new;
  
      if (winPtr->window != None) {
***************
*** 1593,1602 ****
  	parent = winPtr->parentPtr->window;
      }
  
!     if (winPtr->classProcsPtr != NULL
! 	    && winPtr->classProcsPtr->createProc != NULL) {
! 	winPtr->window = (*winPtr->classProcsPtr->createProc)(tkwin, parent,
! 		winPtr->instanceData);
      } else {
  	winPtr->window = TkpMakeWindow(winPtr, parent);
      }
--- 1594,1602 ----
  	parent = winPtr->parentPtr->window;
      }
  
!     createProc = Tk_GetClassProc(winPtr->classProcsPtr, createProc);
!     if (createProc != NULL) {
! 	winPtr->window = (*createProc)(tkwin, parent, winPtr->instanceData);
      } else {
  	winPtr->window = TkpMakeWindow(winPtr, parent);
      }
***************
*** 2149,2155 ****
  /*
   *----------------------------------------------------------------------
   *
!  * TkSetClassProcs --
   *
   *	This procedure is used to set the class procedures and
   *	instance data for a window.
--- 2149,2155 ----
  /*
   *----------------------------------------------------------------------
   *
!  * Tk_SetClassProcs --
   *
   *	This procedure is used to set the class procedures and
   *	instance data for a window.
***************
*** 2165,2173 ****
   */
  
  void
! TkSetClassProcs(tkwin, procs, instanceData)
      Tk_Window tkwin;		/* Token for window to modify. */
!     TkClassProcs *procs;	/* Class procs structure. */
      ClientData instanceData;	/* Data to be passed to class procedures. */
  {
      register TkWindow *winPtr = (TkWindow *) tkwin;
--- 2165,2173 ----
   */
  
  void
! Tk_SetClassProcs(tkwin, procs, instanceData)
      Tk_Window tkwin;		/* Token for window to modify. */
!     Tk_ClassProcs *procs;	/* Class procs structure. */
      ClientData instanceData;	/* Data to be passed to class procedures. */
  {
      register TkWindow *winPtr = (TkWindow *) tkwin;
Index: mac/tkMacButton.c
===================================================================
RCS file: /home/cvs/external/tk/mac/tkMacButton.c,v
retrieving revision 1.13
diff -c -r1.13 tkMacButton.c
*** mac/tkMacButton.c	2000/05/17 21:17:21	1.13
--- mac/tkMacButton.c	2000/11/02 02:45:36
***************
*** 104,113 ****
   * The class procedure table for the button widgets.
   */
  
! TkClassProcs tkpButtonProcs = { 
!     NULL,			/* createProc. */
!     TkButtonWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  /*
--- 104,112 ----
   * The class procedure table for the button widgets.
   */
  
! Tk_ClassProcs tkpButtonProcs = { 
!     sizeof(Tk_ClassProcs),	/* size */
!     TkButtonWorldChanged,	/* worldChangedProc */
  };
  
  /*
Index: mac/tkMacMenubutton.c
===================================================================
RCS file: /home/cvs/external/tk/mac/tkMacMenubutton.c,v
retrieving revision 1.6
diff -c -r1.6 tkMacMenubutton.c
*** mac/tkMacMenubutton.c	1999/09/21 06:42:33	1.6
--- mac/tkMacMenubutton.c	2000/11/02 02:45:36
***************
*** 34,43 ****
   * procedures that can be invoked from generic window code.
   */
  
! TkClassProcs tkpMenubuttonClass = {
!     NULL,			/* createProc. */
!     TkMenuButtonWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  /*
--- 34,42 ----
   * procedures that can be invoked from generic window code.
   */
  
! Tk_ClassProcs tkpMenubuttonClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     TkMenuButtonWorldChanged,	/* worldChangedProc */
  };
  
  /*
Index: mac/tkMacScrlbr.c
===================================================================
RCS file: /home/cvs/external/tk/mac/tkMacScrlbr.c,v
retrieving revision 1.4
diff -c -r1.4 tkMacScrlbr.c
*** mac/tkMacScrlbr.c	2000/02/10 08:56:12	1.4
--- mac/tkMacScrlbr.c	2000/11/02 02:45:36
***************
*** 113,125 ****
  static void		UpdateControlValues _ANSI_ARGS_((MacScrollbar *macScrollPtr));
  		    
  /*
!  * The class procedure table for the scrollbar widget.
   */
  
! TkClassProcs tkpScrollbarProcs = { 
!     NULL,			/* createProc. */
!     NULL,			/* geometryProc. */
!     NULL			/* modalProc */
  };
  
  /*
--- 113,125 ----
  static void		UpdateControlValues _ANSI_ARGS_((MacScrollbar *macScrollPtr));
  		    
  /*
!  * The class procedure table for the scrollbar widget.  Leave the proc fields
!  * initialized to NULL, which should happen automatically because of the scope
!  * at which the variable is declared.
   */
  
! Tk_ClassProcs tkpScrollbarProcs = {
!     sizeof(Tk_ClassProcs)	/* size */
  };
  
  /*
Index: unix/mkLinks
===================================================================
RCS file: /home/cvs/external/tk/unix/mkLinks,v
retrieving revision 1.17
diff -c -r1.17 mkLinks
*** unix/mkLinks	2000/06/03 08:57:34	1.17
--- unix/mkLinks	2000/11/02 02:45:36
***************
*** 28,33 ****
--- 28,37 ----
      exit
  fi
  
+ if test -r SetClassProcs.3; then
+     rm -f Tk_SetClassProcs.3
+     ln SetClassProcs.3 Tk_SetClassProcs.3
+ fi
  if test -r 3DBorder.3; then
      rm -f Tk_Alloc3DBorderFromObj.3
      rm -f Tk_Get3DBorder.3
Index: unix/tkUnixButton.c
===================================================================
RCS file: /home/cvs/external/tk/unix/tkUnixButton.c,v
retrieving revision 1.7
diff -c -r1.7 tkUnixButton.c
*** unix/tkUnixButton.c	2000/07/29 01:08:54	1.7
--- unix/tkUnixButton.c	2000/11/02 02:45:36
***************
*** 26,35 ****
   * The class procedure table for the button widgets.
   */
  
! TkClassProcs tkpButtonProcs = { 
!     NULL,			/* createProc. */
!     TkButtonWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  /*
--- 26,34 ----
   * The class procedure table for the button widgets.
   */
  
! Tk_ClassProcs tkpButtonProcs = {
!     sizeof(Tk_ClassProcs),	/* size */
!     TkButtonWorldChanged,	/* worldChangedProc */
  };
  
  /*
Index: unix/tkUnixMenubu.c
===================================================================
RCS file: /home/cvs/external/tk/unix/tkUnixMenubu.c,v
retrieving revision 1.4
diff -c -r1.4 tkUnixMenubu.c
*** unix/tkUnixMenubu.c	1999/09/21 06:43:01	1.4
--- unix/tkUnixMenubu.c	2000/11/02 02:45:36
***************
*** 19,28 ****
   * procedures that can be invoked from generic window code.
   */
  
! TkClassProcs tkpMenubuttonClass = {
!     NULL,			/* createProc. */
!     TkMenuButtonWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  /*
--- 19,27 ----
   * procedures that can be invoked from generic window code.
   */
  
! Tk_ClassProcs tkpMenubuttonClass = {
!     sizeof(Tk_ClassProcs),	/* size */
!     TkMenuButtonWorldChanged,	/* worldChangedProc */
  };
  
  /*
Index: unix/tkUnixScrlbr.c
===================================================================
RCS file: /home/cvs/external/tk/unix/tkUnixScrlbr.c,v
retrieving revision 1.2
diff -c -r1.2 tkUnixScrlbr.c
*** unix/tkUnixScrlbr.c	1998/09/14 18:23:57	1.2
--- unix/tkUnixScrlbr.c	2000/11/02 02:45:36
***************
*** 32,44 ****
  } UnixScrollbar;
  
  /*
!  * The class procedure table for the scrollbar widget.
   */
  
! TkClassProcs tkpScrollbarProcs = { 
!     NULL,			/* createProc. */
!     NULL,			/* geometryProc. */
!     NULL			/* modalProc. */
  };
  
  
--- 32,44 ----
  } UnixScrollbar;
  
  /*
!  * The class procedure table for the scrollbar widget.  All fields except
!  * size are left initialized to NULL, which should happen automatically
!  * since the variable is declared at this scope.
   */
  
! Tk_ClassProcs tkpScrollbarProcs = {
!     sizeof(Tk_ClassProcs)	/* size */
  };
  
  
Index: win/tkWinButton.c
===================================================================
RCS file: /home/cvs/external/tk/win/tkWinButton.c,v
retrieving revision 1.10
diff -c -r1.10 tkWinButton.c
*** win/tkWinButton.c	2000/07/06 03:17:44	1.10
--- win/tkWinButton.c	2000/11/02 02:45:36
***************
*** 89,98 ****
   * The class procedure table for the button widgets.
   */
  
! TkClassProcs tkpButtonProcs = { 
!     CreateProc,			/* createProc. */
!     TkButtonWorldChanged,	/* geometryProc. */
!     NULL			/* modalProc. */ 
  };
  
  
--- 89,98 ----
   * The class procedure table for the button widgets.
   */
  
! Tk_ClassProcs tkpButtonProcs = { 
!     sizeof(Tk_ClassProcs),	/* size */
!     TkButtonWorldChanged,	/* worldChangedProc */
!     CreateProc,			/* createProc */
  };
  
  
Index: win/tkWinScrlbr.c
===================================================================
RCS file: /home/cvs/external/tk/win/tkWinScrlbr.c,v
retrieving revision 1.5
diff -c -r1.5 tkWinScrlbr.c
*** win/tkWinScrlbr.c	2000/03/31 09:24:27	1.5
--- win/tkWinScrlbr.c	2000/11/02 02:45:36
***************
*** 87,95 ****
   * The class procedure table for the scrollbar widget.
   */
  
! TkClassProcs tkpScrollbarProcs = {
      CreateProc,			/* createProc */
-     NULL,			/* geometryProc */
      ModalLoopProc,		/* modalProc */
  };
  
--- 87,96 ----
   * The class procedure table for the scrollbar widget.
   */
  
! Tk_ClassProcs tkpScrollbarProcs = {
!     sizeof(Tk_ClassProcs),	/* size */
!     NULL,			/* worldChangedProc */
      CreateProc,			/* createProc */
      ModalLoopProc,		/* modalProc */
  };
  
Index: doc/SetClassProcs.3
'\"
'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id$
'\" 
.so man.macros
.TH Tk_SetClassProcs 3 8.4 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_SetClassProcs \- register widget specific procedures
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
\fBTk_SetClassProcs\fR(\fItkwin, procs, instanceData\fR)
.SH ARGUMENTS
.AS Tk_ClassProc instanceData
.AP Tk_Window tkwin in
Token for window to modify.
.AP Tk_ClassProcs *procs in
Pointer to data structure containing widget specific procedures.
The data structure pointed to by \fIprocs\fR must be static:
Tk keeps a reference to it as long as the window exists.
.AP ClientData instanceData in
Arbitrary one-word value to pass to widget callbacks.
.BE

.SH DESCRIPTION
.PP
\fBTk_SetClassProcs\fR is called to register a set of procedures that
are used as callbacks in different places.
.PP
The structure pointed to by \fIprocs\fR contains the following:
.CS
typedef struct Tk_ClassProcs {
	unsigned int \fIsize\fR;
	Tk_ClassWorldChangedProc *\fIworldChangedProc\fR;
	Tk_ClassCreateProc *\fIcreateProc\fR;
	Tk_ClassModalProc *\fImodalProc\fR;
} Tk_ClassProcs;
.CE
The \fIsize\fR field is used to simplify future expansion of the
structure. It should always be set to (literally) \fBsizeof(Tk_ClassProcs)\fR.
.PP
\fIworldChangedProc\fR is invoked when the system has altered
in some way that requires some reaction from the widget.  For example,
when a font alias (see the \fBfont\fR manual entry) is reconfigured,
widgets configured to use that font alias must update their display
accordingly.  \fIworldChangedProc\fR should have arguments and results
that match the type \fBTk_ClassWorldChangedProc\fR:
.CS
typedef void Tk_ClassWorldChangedProc(
	ClientData \fIinstanceData\fR);
.CE
The \fIinstanceData\fR parameter passed to the \fIworldChangedProc\fR
will be identical to the \fIinstanceData\fR paramter passed to
\fBTk_SetClassProcs\fR.
.PP
\fIcreateProc\fR is used to create platform-dependant windows.  It is
invoked by \fBTk_MakeWindowExist\fR.  \fIcreateProc\fR should have
arguments and results that match the type \fBTk_ClassCreateProc\fR:
.CS
typedef Window Tk_ClassCreateProc(
	Tk_Window \fItkwin\fR,
	Window \fIparent\fR,
	ClientData \fIinstanceData\fR);
.CE
The \fItkwin\fR and \fIinstanceData\fR parameters will be identical to
the \fItkwin\fR and \fIinstanceData\fR parameters passed to
\fBTk_SetClassProcs\fR.  The \fIparent\fR parameter will be the parent
of the window to be created.  The \fIcreateProc\fR should return the
created window.
.PP
\fImodalProc\fR is invoked after all bindings on a widget have been
triggered in order to handle a modal loop.  \fImodalProc\fR should
have arguments and results that match the type \fBTk_ClassModalProc\fR:
.CS
typedef void Tk_ClassModalProc(
	Tk_Window \fItkwin\fR,
	XEvent *\fIeventPtr\fR);
.CE
The \fItkwin\fR parameter to \fImodalProc\fR will be identical to the
\fItkwin\fR parameter passed to \fBTk_SetClassProcs\fR.  The
\fIeventPtr\fR parameter will be a pointer to an XEvent structure
describing the event being processed.

.SH KEYWORDS
callback, class
