|
|
* Check that the versions of Tcl that have been loaded are | * Check that the versions of Tcl that have been loaded are |
* the same ones that BLT was compiled against. | * the same ones that BLT was compiled against. |
*/ | */ |
if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) { |
if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) { |
return TCL_ERROR; | return TCL_ERROR; |
} | } |
/* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl | /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl |
|
|
register Tcl_AppInitProc **p; | register Tcl_AppInitProc **p; |
Tcl_Namespace *nsPtr; | Tcl_Namespace *nsPtr; |
| |
|
if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) { |
|
return TCL_OK; |
|
} |
|
|
|
#if 0 |
#if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) | #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) |
if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) { | if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) { |
return TCL_OK; | return TCL_OK; |
} |
} |
#else | #else |
if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) { | if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) { |
Tcl_ResetResult(interp); | Tcl_ResetResult(interp); |
return TCL_OK; | return TCL_OK; |
} | } |
#endif | #endif |
|
#endif |
|
|
nsPtr = Tcl_CreateNamespace(interp, "blt::tile", NULL, | nsPtr = Tcl_CreateNamespace(interp, "blt::tile", NULL, |
(Tcl_NamespaceDeleteProc *) NULL); | (Tcl_NamespaceDeleteProc *) NULL); |
if (nsPtr == NULL) { | if (nsPtr == NULL) { |
|
|
* Check that the versions of Tcl that have been loaded are | * Check that the versions of Tcl that have been loaded are |
* the same ones that BLT was compiled against. | * the same ones that BLT was compiled against. |
*/ | */ |
if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) { |
if (Tcl_InitStubs(interp, TCL_VERSION, EXACT) == NULL) { |
return TCL_ERROR; | return TCL_ERROR; |
} | } |
/* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl | /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl |
|
|
if (!tkLoaded) { | if (!tkLoaded) { |
register Tcl_AppInitProc **p; | register Tcl_AppInitProc **p; |
| |
|
if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) { |
|
return TCL_OK; |
|
} |
|
|
|
#if 0 |
#if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) | #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0)) |
if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) { | if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) { |
return TCL_OK; | return TCL_OK; |
|
|
return TCL_OK; | return TCL_OK; |
} | } |
#endif | #endif |
|
#endif |
|
|
/* Initialize the BLT commands that use Tk too. */ | /* Initialize the BLT commands that use Tk too. */ |
for (p = tkCmds; *p != NULL; p++) { | for (p = tkCmds; *p != NULL; p++) { |
if ((**p) (interp) != TCL_OK) { | if ((**p) (interp) != TCL_OK) { |