diff options
Diffstat (limited to 'generic/tkInitScript.h')
-rw-r--r-- | generic/tkInitScript.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tkInitScript.h b/generic/tkInitScript.h index e86d16e..3809a01 100644 --- a/generic/tkInitScript.h +++ b/generic/tkInitScript.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * SCCS: @(#) tkInitScript.h 1.3 97/08/11 19:12:28 + * SCCS: @(#) tkInitScript.h 1.4 98/01/09 13:37:34 */ @@ -22,10 +22,15 @@ * initialization. * When called from a safe interpreter, it does not use file exists. * we don't use pwd either because of safe interpreters. + * + * We leave the door open to the application by using an existing + * tkInit proc which if it exists is responsible for finding and sourcing + * tk.tcl themselves. With that, an application that wish to ignore + * the env(TK_LIBRARY) or have special initialization need can do it. */ -static char initScript[] = -"proc tkInit {} {\n\ +static char initScript[] = "if {[info proc tkInit]==\"\"} {\n\ + proc tkInit {} {\n\ global tk_library tk_version tk_patchLevel env errorInfo\n\ rename tkInit {}\n\ set errors \"\"\n\ @@ -68,6 +73,7 @@ static char initScript[] = append msg \"$errors\n\n\"\n\ append msg \"This probably means that Tk wasn't installed properly.\n\"\n\ error $msg\n\ + }\n\ }\n\ tkInit"; |