summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-09-06 19:33:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-09-06 19:33:55 (GMT)
commit9eeb6e7a4f32a9f04cd022da83bea178402826a0 (patch)
tree4aebeffff53b38e3d8e3842c7690bccefd435a3c /generic/tkWindow.c
parent3ef61115ff6c1802994c2c0e59e140cf7f628220 (diff)
downloadtk-9eeb6e7a4f32a9f04cd022da83bea178402826a0.zip
tk-9eeb6e7a4f32a9f04cd022da83bea178402826a0.tar.gz
tk-9eeb6e7a4f32a9f04cd022da83bea178402826a0.tar.bz2
* generic/tkWindow.c (Initialize): Moved common Tk initialization
* generic/tkInitScript.h (removed): script out of tkInitScript.h * macosx/tkMacOSXInit.c: and multiple TkpInit() routines and * unix/Makefile.in: into the common Initialize() routine in * unix/tkUnixInit.c: generic code. Also removed constraint on * win/tkWinInit.c: ability to define a custom [tkInit] before calling Tk_Init(). Until now the custom [tkInit] had to be a proc. Now it can be any command. Removal of tkInitScript.h also fixes [Bug 1656283].
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 4a821e0..2397347 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.80 2007/02/13 00:16:39 dkf Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.81 2007/09/06 19:33:55 dgp Exp $
*/
#include "tkPort.h"
@@ -3233,6 +3233,28 @@ Initialize(
}
code = TkpInit(interp);
if (code == TCL_OK) {
+
+ /*
+ * In order to find tk.tcl during initialization, we evaluate the
+ * following script. It calls on the Tcl command [tcl_findLibrary]
+ * to perform the search. See the docs for that command for details
+ * on where it looks.
+ *
+ * Note that this entire search mechanism can be bypassed by defining
+ * an alternate [tkInit] command before calling Tk_Init().
+ */
+
+ code = Tcl_Eval(interp,
+"if {[namespace which -command tkInit] eq \"\"} {\n\
+ proc tkInit {} {\n\
+ global tk_library tk_version tk_patchLevel\n\
+ rename tkInit {}\n\
+ tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\
+ }\n\
+}\n\
+tkInit");
+ }
+ if (code == TCL_OK) {
/*
* Create exit handlers to delete all windows when the application or
* thread exits. The handler need to be invoked before other platform