From 09e0c9f40ad5820cfb05bed697dcc58ce136b7b9 Mon Sep 17 00:00:00 2001 From: hobbs Date: Sat, 31 Mar 2001 05:46:10 +0000 Subject: * tests/safe.test: added note about correcting failures in safe.test. * library/tk.tcl: moved package require msgcat inside if case to not be used in safe interps. --- ChangeLog | 5 +++++ library/tk.tcl | 9 +++------ tests/safe.test | 35 +++++++++++++++++++++-------------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 829de88..980cf22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-03-30 Jeff Hobbs + * tests/safe.test: added note about correcting failures in + safe.test. + * library/tk.tcl: moved package require msgcat inside if case to + not be used in safe interps. + * win/makefile.vc: * win/configure: * win/tcl.m4: added imm32.lib to LIBS_GUI for Tk IME support. diff --git a/library/tk.tcl b/library/tk.tcl index b49362b..daba5d6 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -3,7 +3,7 @@ # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # -# RCS: @(#) $Id: tk.tcl,v 1.28 2001/03/30 07:04:35 hobbs Exp $ +# RCS: @(#) $Id: tk.tcl,v 1.29 2001/03/31 05:46:10 hobbs Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. @@ -13,11 +13,11 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # Insist on running with compatible versions of Tcl and Tk. - package require -exact Tk 8.4 package require -exact Tcl 8.4 -package require msgcat + if { ![interp issafe] } { + package require msgcat ::msgcat::mcload [file join $::tk_library msgs] } @@ -314,11 +314,9 @@ switch $tcl_platform(platform) { event add <> } } - # ---------------------------------------------------------------------- # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- - if {[string compare $tcl_platform(platform) "macintosh"] && \ [string compare {} $tk_library]} { source [file join $tk_library button.tcl] @@ -330,7 +328,6 @@ if {[string compare $tcl_platform(platform) "macintosh"] && \ source [file join $tk_library spinbox.tcl] source [file join $tk_library text.tcl] } - # ---------------------------------------------------------------------- # Default bindings for keyboard traversal. # ---------------------------------------------------------------------- diff --git a/tests/safe.test b/tests/safe.test index b791811..bf1b945 100644 --- a/tests/safe.test +++ b/tests/safe.test @@ -6,12 +6,32 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: safe.test,v 1.6 1999/12/14 06:53:13 hobbs Exp $ +# RCS: @(#) $Id: safe.test,v 1.7 2001/03/31 05:46:10 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] } +## NOTE: Any time tests fail here with an error like: + +# Can't find a usable tk.tcl in the following directories: +# {$p(:26:)} +# +# $p(:26:)/tk.tcl: script error +# script error +# invoked from within +# "source {$p(:26:)/tk.tcl}" +# ("uplevel" body line 1) +# invoked from within +# "uplevel #0 [list source $file]" +# +# +# This probably means that tk wasn't installed properly. + +## it indicates that something went wrong sourcing tk.tcl. +## Ensure that any changes that occured to tk.tcl will work or +## are properly prevented in a safe interpreter. -- hobbs + foreach i [winfo children .] { destroy $i } @@ -176,16 +196,3 @@ test safe-7.1 {canvas printing} { unset hidden_cmds ::tcltest::cleanupTests return - - - - - - - - - - - - - -- cgit v0.12