diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2009-12-10 00:34:11 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2009-12-10 00:34:11 (GMT) |
commit | 9245eb13652d2e516a08010da3d69a37ff99d41f (patch) | |
tree | f299efda25a99924d3a0fe2fabcc7f29c735c595 /library/safetk.tcl | |
parent | 36d51bd19395d8947156b37392a1ac4c6c3df55a (diff) | |
download | tk-9245eb13652d2e516a08010da3d69a37ff99d41f.zip tk-9245eb13652d2e516a08010da3d69a37ff99d41f.tar.gz tk-9245eb13652d2e516a08010da3d69a37ff99d41f.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-12-09. See
Tcl's ChangeLog.
FossilOrigin-Name: f152162c2655281297997481f2b53faf13136ad4
Diffstat (limited to 'library/safetk.tcl')
-rw-r--r-- | library/safetk.tcl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/library/safetk.tcl b/library/safetk.tcl index 58cb954..ae198d9 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.12.2.1 2009/12/10 00:34:12 andreas_kupries Exp $ # # Copyright (c) 1997 Sun Microsystems, Inc. # @@ -81,19 +81,23 @@ 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 # 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]} { |