summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--mac/tkMacApplication.r10
-rw-r--r--mac/tkMacInit.c40
-rw-r--r--mac/tkMacLibrary.r8
-rw-r--r--mac/tkMacResource.r18
5 files changed, 43 insertions, 42 deletions
diff --git a/ChangeLog b/ChangeLog
index c911d24..f331522 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-12-28 Daniel Steffen <das@users.sourceforge.net>
+
+ * mac/mac/tkMacInit.c:
+ * mac/mac/tkMacResource.r: synced up tkInit features to unix/win:
+ use existing tkInit proc if defined. Added spinbox.tcl resource.
+ Used TclGetEnv() instead of Tcl_GetVar2(interp, env)
+ * mac/tkMacApplication.r:
+ * mac/tkMacLibrary.r: minor version resources cleanup
+
2001-12-20 Mo DeJong <mdejong@users.sourceforge.net>
* unix/configure: Regen.
diff --git a/mac/tkMacApplication.r b/mac/tkMacApplication.r
index 5191647..7be4472 100644
--- a/mac/tkMacApplication.r
+++ b/mac/tkMacApplication.r
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacApplication.r,v 1.5 2001/11/23 02:05:32 das Exp $
+ * RCS: @(#) $Id: tkMacApplication.r,v 1.6 2001/12/27 22:45:07 das Exp $
*/
#include <Types.r>
@@ -35,22 +35,22 @@
#if (TK_RELEASE_LEVEL == 2)
# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+# define RELEASE_CODE 0x00
#else
# define MINOR_VERSION TK_MINOR_VERSION * 16
+# define RELEASE_CODE TK_RELEASE_SERIAL
#endif
-#define RELEASE_CODE 0x00
-
resource 'vers' (1) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
};
resource 'vers' (2) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
"Wish " TK_PATCH_LEVEL " © 1993-2001"
};
diff --git a/mac/tkMacInit.c b/mac/tkMacInit.c
index ad3118e..9e70594 100644
--- a/mac/tkMacInit.c
+++ b/mac/tkMacInit.c
@@ -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.
*
- * RCS: @(#) $Id: tkMacInit.c,v 1.4 2001/11/23 02:05:52 das Exp $
+ * RCS: @(#) $Id: tkMacInit.c,v 1.5 2001/12/27 22:45:10 das Exp $
*/
#include <Resources.h>
@@ -55,27 +55,23 @@ TkpInit(
Tcl_Interp *interp) /* Interp to initialize. */
{
char *libDir, *tempPath;
- Tcl_DString path;
+ Tcl_DString path, ds;
int result;
- /*
- * The following does not work with
- * safe interps because file exists is restricted.
- * to be fixed using [interp issafe] like in Unix & Windows.
- */
- static char initCmd[] = "\
+ static char initCmd[] = "if {[info proc tkInit]==\"\"} {\n\
+proc tkInit {} {\n\
proc sourcePath {file} {\n\
global tk_library\n\
- if {[catch {uplevel #0 [list source $tk_library:$file.tcl]}] == 0} {\n\
+ if {[catch {uplevel #0 [list source [file join $tk_library $file.tcl]]}] == 0} {\n\
return\n\
}\n\
if {[catch {uplevel #0 [list source -rsrc $file]}] == 0} {\n\
return\n\
}\n\
rename sourcePath {}\n\
- set msg \"can't find $file resource or a usable $file.tcl file\"\n\
- append msg \" perhaps you need to install Tk or set your \"\n\
- append msg \"TK_LIBRARY environment variable?\"\n\
+ set msg \"Can't find $file resource or a usable $file.tcl file\"\n\
+ append msg \" perhaps you need to install Tk or set your\"\n\
+ append msg \" TK_LIBRARY environment variable?\"\n\
error $msg\n\
}\n\
sourcePath tk\n\
@@ -94,9 +90,14 @@ sourcePath text\n\
sourcePath bgerror\n\
sourcePath msgbox\n\
sourcePath comdlg\n\
-rename sourcePath {}";
+sourcePath spinbox\n\
+rename sourcePath {}\n\
+rename tkInit {}\n\
+} }\n\
+tkInit";
Tcl_DStringInit(&path);
+ Tcl_DStringInit(&ds);
/*
* The tk_library path can be found in several places. Here is the order
@@ -108,11 +109,11 @@ rename sourcePath {}";
libDir = Tcl_GetVar(interp, "tk_library", TCL_GLOBAL_ONLY);
if (libDir == NULL) {
- libDir = Tcl_GetVar2(interp, "env", "TK_LIBRARY", TCL_GLOBAL_ONLY);
+ libDir = TclGetEnv("TK_LIBRARY", &ds);
}
- if (libDir == NULL) {
- tempPath = Tcl_GetVar2(interp, "env", "EXT_FOLDER", TCL_GLOBAL_ONLY);
- if (tempPath != NULL) {
+ if ((libDir == NULL) || (libDir[0] == '\0')) {
+ tempPath = TclGetEnv("EXT_FOLDER", &ds);
+ if ((tempPath != NULL) && (tempPath[0] != '\0')) {
Tcl_DString libPath;
char *argv[3];
@@ -121,10 +122,10 @@ rename sourcePath {}";
Tcl_DStringInit(&libPath);
Tcl_DStringAppend(&libPath, "tk", -1);
Tcl_DStringAppend(&libPath, TK_VERSION, -1);
- argv[2] = libPath.string;
+ argv[2] = Tcl_DStringValue(&libPath);
Tcl_JoinPath(3, argv, &path);
Tcl_DStringFree(&libPath);
- libDir = path.string;
+ libDir = Tcl_DStringValue(&path);
}
}
if (libDir == NULL) {
@@ -136,6 +137,7 @@ rename sourcePath {}";
*/
Tcl_SetVar(interp, "tk_library", libDir, TCL_GLOBAL_ONLY);
Tcl_DStringFree(&path);
+ Tcl_DStringFree(&ds);
result = Tcl_Eval(interp, initCmd);
return result;
diff --git a/mac/tkMacLibrary.r b/mac/tkMacLibrary.r
index 8be084c..efc3858 100644
--- a/mac/tkMacLibrary.r
+++ b/mac/tkMacLibrary.r
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacLibrary.r,v 1.6 2001/11/23 02:05:58 das Exp $
+ * RCS: @(#) $Id: tkMacLibrary.r,v 1.7 2001/12/27 22:45:13 das Exp $
*/
#include <Types.r>
@@ -36,22 +36,24 @@
#if (TK_RELEASE_LEVEL == 2)
# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
+# define RELEASE_CODE 0x00
#else
# define MINOR_VERSION TK_MINOR_VERSION * 16
+# define RELEASE_CODE TK_RELEASE_SERIAL
#endif
#define RELEASE_CODE 0x00
resource 'vers' (1) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
TK_PATCH_LEVEL ", by Ray Johnson & Jim Ingham" "\n" "© 2001 Tcl Core Team"
};
resource 'vers' (2) {
TK_MAJOR_VERSION, MINOR_VERSION,
- RELEASE_LEVEL, 0x00, verUS,
+ RELEASE_LEVEL, RELEASE_CODE, verUS,
TK_PATCH_LEVEL,
"Tk Library " TK_PATCH_LEVEL " © 1993-2001"
};
diff --git a/mac/tkMacResource.r b/mac/tkMacResource.r
index e82719c..16a78aa 100644
--- a/mac/tkMacResource.r
+++ b/mac/tkMacResource.r
@@ -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: tkMacResource.r,v 1.7 2001/11/23 02:06:18 das Exp $
+ * RCS: @(#) $Id: tkMacResource.r,v 1.8 2001/12/27 22:45:16 das Exp $
*/
/*
@@ -32,20 +32,6 @@
#include "tcl.h"
#include "tk.h"
-#if (TK_RELEASE_LEVEL == 0)
-# define RELEASE_LEVEL alpha
-#elif (TK_RELEASE_LEVEL == 1)
-# define RELEASE_LEVEL beta
-#elif (TK_RELEASE_LEVEL == 2)
-# define RELEASE_LEVEL final
-#endif
-
-#if (TK_RELEASE_LEVEL == 2)
-# define MINOR_VERSION (TK_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
-#else
-# define MINOR_VERSION TK_MINOR_VERSION * 16
-#endif
-
#define TK_LIBRARY_RESOURCES 3000
/*
@@ -94,6 +80,8 @@ read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable)
"::library:msgbox.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable)
"::library:comdlg.tcl";
+read 'TEXT' (TK_LIBRARY_RESOURCES+18, "spinbox", purgeable)
+ "::library:spinbox.tcl";
/*