summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordas <das>2001-10-19 19:40:17 (GMT)
committerdas <das>2001-10-19 19:40:17 (GMT)
commitdf1d74d89eeea6f0a449ccd3b6b404a425cd64ff (patch)
tree230544bc6c88f82c8a23b49a5a3efc1ddde491b3
parentdffd1d671bd65b7eec86779f2b95ca68b085ccdb (diff)
downloadtk-df1d74d89eeea6f0a449ccd3b6b404a425cd64ff.zip
tk-df1d74d89eeea6f0a449ccd3b6b404a425cd64ff.tar.gz
tk-df1d74d89eeea6f0a449ccd3b6b404a425cd64ff.tar.bz2
* generic/tkConsole.c:
* library/console.tcl: * mac/tkMacInit.c: * mac/tkMacResource.r: corrected how mac deals with tcl library files present both in resources and in $tk_library directory.
-rw-r--r--ChangeLog12
-rw-r--r--generic/tkConsole.c4
-rw-r--r--library/console.tcl4
-rw-r--r--mac/tkMacInit.c75
-rw-r--r--mac/tkMacResource.r16
5 files changed, 55 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 98b1ccc..6ec9624 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,17 @@
-2001-10-19 Jeff Hobbs <jeffh@ActiveState.com>
+2001-10-19 Daniel Steffen <das@users.sourceforge.net>
************************
**** 8.3.4 TAGGED ****
************************
+ * generic/tkConsole.c:
+ * library/console.tcl:
+ * mac/tkMacInit.c:
+ * mac/tkMacResource.r: corrected how mac deals with tcl library
+ files present both in resources and in $tk_library directory.
+
+2001-10-19 Jeff Hobbs <jeffh@ActiveState.com>
+
* library/tk.tcl: added tk::GetSelection from 8.4 for console.
* library/console.tcl: fixed a few errors where namespace command
@@ -37,7 +45,7 @@
initialization
* mac/tkMacMenu.c: special MDEF_PROC_OFFSET only needed for
- exactly one specifc version of the MWERKS 68k compiler .
+ exactly one specific version of the MWERKS 68k compiler .
* mac/tkMacApplication.r:
* mac/tkMacLibrary.r:
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 0139260..054928d 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -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: tkConsole.c,v 1.11.2.2 2001/10/17 19:29:51 das Exp $
+ * RCS: @(#) $Id: tkConsole.c,v 1.11.2.3 2001/10/19 19:40:17 das Exp $
*/
#include "tk.h"
@@ -336,7 +336,7 @@ Tk_CreateConsoleWindow(interp)
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
#ifdef MAC_TCL
- static char initCmd[] = "source -rsrc {Console}";
+ static char initCmd[] = "if {[catch {source $tk_library:console.tcl}]} {source -rsrc console}";
#else
static char initCmd[] = "source $tk_library/console.tcl";
#endif
diff --git a/library/console.tcl b/library/console.tcl
index 879a340..7831e7b 100644
--- a/library/console.tcl
+++ b/library/console.tcl
@@ -4,7 +4,7 @@
# can be used by non-unix systems that do not have built-in support
# for shells.
#
-# RCS: @(#) $Id: console.tcl,v 1.8.2.3 2001/10/19 17:33:27 hobbs Exp $
+# RCS: @(#) $Id: console.tcl,v 1.8.2.4 2001/10/19 19:40:17 das Exp $
#
# Copyright (c) 1998-1999 Scriptics Corp.
# Copyright (c) 1995-1997 Sun Microsystems, Inc.
@@ -442,7 +442,7 @@ proc tkConsoleBind {w} {
bind Console <F9> {
eval destroy [winfo child .]
if {[string equal $tcl_platform(platform) "macintosh"]} {
- source -rsrc Console
+ if {[catch {source $tk_library:console.tcl}]} {source -rsrc console}
} else {
source [file join $tk_library console.tcl]
}
diff --git a/mac/tkMacInit.c b/mac/tkMacInit.c
index 0e7001f..e0ff78d 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.3.12.1 2001/10/17 19:29:51 das Exp $
+ * RCS: @(#) $Id: tkMacInit.c,v 1.3.12.2 2001/10/19 19:40:18 das Exp $
*/
#include <Resources.h>
@@ -63,24 +63,38 @@ TkpInit(
* safe interps because file exists is restricted.
* to be fixed using [interp issafe] like in Unix & Windows.
*/
- static char initCmd[] =
- "if [file exists $tk_library:tk.tcl] {\n\
- source $tk_library:tk.tcl\n\
- source $tk_library:button.tcl\n\
- source $tk_library:entry.tcl\n\
- source $tk_library:listbox.tcl\n\
- source $tk_library:menu.tcl\n\
- source $tk_library:scale.tcl\n\
- source $tk_library:scrlbar.tcl\n\
- source $tk_library:text.tcl\n\
- source $tk_library:comdlg.tcl\n\
- source $tk_library:msgbox.tcl\n\
- } else {\n\
- set msg \"can't find tk resource or $tk_library:tk.tcl;\"\n\
- append msg \" perhaps you need to\\ninstall Tk or set your \"\n\
- append msg \"TK_LIBRARY environment variable?\"\n\
- error $msg\n\
- }";
+ static char initCmd[] = "\
+proc sourcePath {file} {\n\
+ global tk_library\n\
+ if {[catch {uplevel #0 [list source $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\
+ error $msg\n\
+}\n\
+sourcePath tk\n\
+sourcePath button\n\
+sourcePath dialog\n\
+sourcePath entry\n\
+sourcePath focus\n\
+sourcePath listbox\n\
+sourcePath menu\n\
+sourcePath optMenu\n\
+sourcePath palette\n\
+sourcePath scale\n\
+sourcePath scrlbar\n\
+sourcePath tearoff\n\
+sourcePath text\n\
+sourcePath bgerror\n\
+sourcePath msgbox\n\
+sourcePath comdlg\n\
+rename sourcePath {}";
Tcl_DStringInit(&path);
@@ -123,30 +137,7 @@ TkpInit(
Tcl_SetVar(interp, "tk_library", libDir, TCL_GLOBAL_ONLY);
Tcl_DStringFree(&path);
- /*
- * Source the needed Tk libraries from the resource
- * fork of the application.
- */
- result = Tcl_MacEvalResource(interp, "tk", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "button", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "entry", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "listbox", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "menu", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "scale", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "scrollbar", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "text", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "dialog", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "focus", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "optionMenu", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "palette", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "tearoff", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "tkerror", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "comdlg", 0, NULL);
- result |= Tcl_MacEvalResource(interp, "msgbox", 0, NULL);
-
- if (result != TCL_OK) {
result = Tcl_Eval(interp, initCmd);
- }
return result;
}
diff --git a/mac/tkMacResource.r b/mac/tkMacResource.r
index 1a59a94..10541b3 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.6.2.2 2001/10/17 19:29:52 das Exp $
+ * RCS: @(#) $Id: tkMacResource.r,v 1.6.2.3 2001/10/19 19:40:18 das Exp $
*/
/*
@@ -60,7 +60,7 @@
* will load the TEXT resource named "Init".
*/
-read 'TEXT' (TK_LIBRARY_RESOURCES+1, "tk", purgeable)
+read 'TEXT' (TK_LIBRARY_RESOURCES+1, "tk", purgeable,preload)
"::library:tk.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+2, "button", purgeable)
"::library:button.tcl";
@@ -74,25 +74,25 @@ read 'TEXT' (TK_LIBRARY_RESOURCES+6, "listbox", purgeable)
"::library:listbox.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+7, "menu", purgeable)
"::library:menu.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+8, "optionMenu", purgeable)
+read 'TEXT' (TK_LIBRARY_RESOURCES+8, "optMenu", purgeable)
"::library:optMenu.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+9, "palette", purgeable)
"::library:palette.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+10, "scale", purgeable)
"::library:scale.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+11, "scrollbar", purgeable)
+read 'TEXT' (TK_LIBRARY_RESOURCES+11, "scrlbar", purgeable)
"::library:scrlbar.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+12, "tearoff", purgeable)
"::library:tearoff.tcl";
read 'TEXT' (TK_LIBRARY_RESOURCES+13, "text", purgeable)
"::library:text.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+14, "tkerror", purgeable)
+read 'TEXT' (TK_LIBRARY_RESOURCES+14, "bgerror", purgeable)
"::library:bgerror.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+15, "Console", purgeable)
+read 'TEXT' (TK_LIBRARY_RESOURCES+15, "console", purgeable)
"::library:console.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable, preload)
+read 'TEXT' (TK_LIBRARY_RESOURCES+16, "msgbox", purgeable)
"::library:msgbox.tcl";
-read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable, preload)
+read 'TEXT' (TK_LIBRARY_RESOURCES+17, "comdlg", purgeable)
"::library:comdlg.tcl";