summaryrefslogtreecommitdiffstats
path: root/library/safetk.tcl
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-11-23 19:17:29 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-11-23 19:17:29 (GMT)
commit0bfb01662737f65ab1bd1b50b5059f091bf3a567 (patch)
tree1defe0a06517ee528e64505adf973d23ae8df077 /library/safetk.tcl
parentbb110b19891f138458016add065c7dae4d7e2b39 (diff)
downloadtk-0bfb01662737f65ab1bd1b50b5059f091bf3a567.zip
tk-0bfb01662737f65ab1bd1b50b5059f091bf3a567.tar.gz
tk-0bfb01662737f65ab1bd1b50b5059f091bf3a567.tar.bz2
* library/safetk.tcl (::safe::loadTk): [Bug 2902573]: Fixed access
to the cleanupHook of the safe base. The code used the old internal commands which have been removed since 2009-11-05/06. See Tcl's ChangeLog.
Diffstat (limited to 'library/safetk.tcl')
-rw-r--r--library/safetk.tcl14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/safetk.tcl b/library/safetk.tcl
index 58cb954..8effc2a 100644
--- a/library/safetk.tcl
+++ b/library/safetk.tcl
@@ -2,7 +2,7 @@
#
# Support procs to use Tk in safe interpreters.
#
-# RCS: @(#) $Id: safetk.tcl,v 1.12 2008/03/27 21:05:09 hobbs Exp $
+# RCS: @(#) $Id: safetk.tcl,v 1.13 2009/11/23 19:17:30 andreas_kupries Exp $
#
# Copyright (c) 1997 Sun Microsystems, Inc.
#
@@ -81,19 +81,21 @@ proc ::safe::loadTk {} {}
}
}
}
+
+ # Get state for access to the cleanupHook.
+ namespace upvar ::safe S$slave state
+
if {![::tcl::OptProcArgGiven "-use"]} {
# create a decorated toplevel
- ::tcl::Lassign [tkTopLevel $slave $display] w use
+ lassign [tkTopLevel $slave $display] w use
# set our delete hook (slave arg is added by interpDelete)
# to clean up both window related code and tkInit(slave)
- Set [DeleteHookName $slave] [list tkDelete {} $w]
-
+ set state(cleanupHook) [list tkDelete {} $w]
} else {
-
# set our delete hook (slave arg is added by interpDelete)
# to clean up tkInit(slave)
- Set [DeleteHookName $slave] [list disallowTk]
+ set state(cleanupHook) [list disallowTk]
# Let's be nice and also accept tk window names instead of ids
if {[string match ".*" $use]} {