Attachment "tk-macosx.patch.20011216" to
ticket [495549ffff]
added by
tonylownds
2001-12-21 02:07:04.
? build
? Wish.pbproj/tlownds.pbxuser
Index: tkMacOSXAppInit.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/macosx/Attic/tkMacOSXAppInit.c,v
retrieving revision 1.1.2.4
diff -c -r1.1.2.4 tkMacOSXAppInit.c
*** tkMacOSXAppInit.c 2001/11/11 17:54:40 1.1.2.4
--- tkMacOSXAppInit.c 2001/12/17 00:51:04
***************
*** 26,34 ****
#define MAX_PATH_LEN 1024
#endif
- extern void TkMacOSXInitAppleEvents(Tcl_Interp *interp);
- extern void TkMacOSXInitMenus(Tcl_Interp *interp);
-
/*
* The following variable is a special hack that is needed in order for
* Sun shared libraries to be used for Tcl.
--- 26,31 ----
***************
*** 94,109 ****
#endif
extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
-
- /*
- * NB - You have to swap in the Tk Notifier BEFORE you start up the
- * Tcl interpreter for now. It probably should work to do this
- * in the other order, but for now it doesn't seem to.
- */
-
scriptPath[0] = '\0';
-
- Tk_MacOSXSetupTkNotifier();
/*
* The following #if block allows you to change how Tcl finds the startup
--- 91,97 ----
***************
*** 245,253 ****
Tcl_SetVar(interp, "auto_path", scriptPath,
TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
}
-
- TkMacOSXInitAppleEvents(interp);
- TkMacOSXInitMenus(interp);
#ifdef TK_TEST
if (Tcltest_Init(interp) == TCL_ERROR) {
--- 233,238 ----
Index: tkMacOSXInit.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/macosx/Attic/tkMacOSXInit.c,v
retrieving revision 1.1.2.2
diff -c -r1.1.2.2 tkMacOSXInit.c
*** tkMacOSXInit.c 2001/11/11 17:54:40 1.1.2.2
--- tkMacOSXInit.c 2001/12/17 00:51:05
***************
*** 47,53 ****
{
char tkLibPath[1024];
int result;
!
Tcl_SetVar2(interp, "tcl_platform", "windowingsystem", "aqua", TCL_GLOBAL_ONLY);
/*
--- 47,64 ----
{
char tkLibPath[1024];
int result;
! static int menusInitialized = false;
!
! /* Since it is possible for TkInit to be called multiple times
! * and we don't want to do the menu initialization multiple times
! * we protect against doing it more than once.
! */
! if (menusInitialized == false) {
! menusInitialized = true;
! Tk_MacOSXSetupTkNotifier(); // as done in tkMacOSXAppInit.c:main()
! TkMacOSXInitAppleEvents(interp); // as done in tkMacOSXAppInit.c:Tcl_AppInit()
! TkMacOSXInitMenus(interp); // as done in tkMacOSXAppInit.c:Tcl_AppInit()
! }
Tcl_SetVar2(interp, "tcl_platform", "windowingsystem", "aqua", TCL_GLOBAL_ONLY);
/*
***************
*** 134,137 ****
Tcl_WriteChars(errChannel, msg, -1);
Tcl_WriteChars(errChannel, "\n", 1);
}
! }
\ No newline at end of file
--- 145,148 ----
Tcl_WriteChars(errChannel, msg, -1);
Tcl_WriteChars(errChannel, "\n", 1);
}
! }
Index: tkMacOSXNotify.c
===================================================================
RCS file: /cvsroot/tktoolkit/tk/macosx/Attic/tkMacOSXNotify.c,v
retrieving revision 1.1.2.1
diff -c -r1.1.2.1 tkMacOSXNotify.c
*** tkMacOSXNotify.c 2001/10/15 09:22:00 1.1.2.1
--- tkMacOSXNotify.c 2001/12/17 00:51:07
***************
*** 228,233 ****
--- 228,239 ----
};
Tcl_SetNotifier(&macNotifierProcs);
+
+ // Tcl_SetNotifier doesn't call the TclInitNotifier
+ // so we call it now. If we don't do this the
+ // ThreadSpecificData will keep a pointer to the original
+ // InitNotifier. See tclNotify.c:TclInitNotifier().
+ TclInitNotifier();
}
/*