@@ -1,6 +1,17 @@ -#include +#ifdef KIT_INCLUDES_TK +# include +#else +# include +#endif /* KIT_INCLUDES_TK */ + +#ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN +# include +# undef WIN32_LEAN_AND_MEAN +#endif /* _WIN32 */ + #include "tclInt.h" #if defined(HAVE_TCL_GETENCODINGNAMEFROMENVIRONMENT) && defined(HAVE_TCL_SETSYSTEMENCODING) # define TCLKIT_CAN_SET_ENCODING 1 #endif @@ -33,10 +44,15 @@ "set s [read $f]\n" "close $f\n" "::tclkit::init::initInterp\n" "rename ::tclkit::init::initInterp {}\n" "uplevel #0 $s\n" +#if defined(KIT_INCLUDES_TK) && defined(KIT_TK_VERSION) + "package ifneeded Tk " KIT_TK_VERSION " {\n" + "load {} Tk\n" + "}\n" +#endif #ifdef _WIN32 "catch {load {} dde}\n" "catch {load {} registry}\n" #endif /* _WIN32 */ "}\n" @@ -87,10 +103,13 @@ #endif #ifdef _WIN32 Tcl_StaticPackage(0, "dde", Dde_Init, NULL); Tcl_StaticPackage(0, "registry", Registry_Init, NULL); #endif +#ifdef KIT_INCLUDES_TK + Tcl_StaticPackage(0, "Tk", Tk_Init, Tk_SafeInit); +#endif TclSetPreInitScript(preInitCmd); return; }