diff options
Diffstat (limited to 'library/safetk.tcl')
-rw-r--r-- | library/safetk.tcl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/library/safetk.tcl b/library/safetk.tcl index c975fd6..9f8e25d 100644 --- a/library/safetk.tcl +++ b/library/safetk.tcl @@ -85,14 +85,12 @@ proc ::safe::loadTk {} {} 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 state(cleanupHook) [list tkDelete {} $w] - } else { - # set our delete hook (slave arg is added by interpDelete) # to clean up tkInit(slave) set state(cleanupHook) [list disallowTk] @@ -116,8 +114,8 @@ proc ::safe::loadTk {} {} } if {$nDisplay ne $display} { if {$displayGiven} { - error "conflicting -display $display and -use\ - $use -> $nDisplay" + return -code error -errorcode {TK DISPLAY SAFE} \ + "conflicting -display $display and -use $use -> $nDisplay" } else { set display $nDisplay } @@ -141,7 +139,7 @@ proc ::safe::TkInit {interpPath} { } else { Log $interpPath "TkInit called for interp with clearance:\ preventing Tk init" ERROR - error "not allowed" + return -code error -errorcode {TK SAFE PERMISSION} "not allowed" } } @@ -221,8 +219,8 @@ proc ::safe::tkTopLevel {slave display} { incr tkSafeId set w ".safe$tkSafeId" if {[catch {toplevel $w -screen $display -class SafeTk} msg]} { - return -code error "Unable to create toplevel for\ - safe slave \"$slave\" ($msg)" + return -code error -errorcode {TK TOPLEVEL SAFE} \ + "Unable to create toplevel for safe slave \"$slave\" ($msg)" } Log $slave "New toplevel $w" NOTICE |