From b535e9b004097dd567a7c6d461a5b224bbf47991 Mon Sep 17 00:00:00 2001 From: nagai Date: Mon, 25 Jul 2005 05:11:19 +0000 Subject: * ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/lib/multi-tk.rb | 63 ++++++-------------------------------------------- ext/tk/lib/tk.rb | 2 +- 2 files changed, 8 insertions(+), 57 deletions(-) (limited to 'ext/tk/lib') diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 3119080734..8ef3aa62bf 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -1411,7 +1411,7 @@ class MultiTkIp if @cmd_receiver == Thread.current || (!req_val && TclTkLib.mainloop_thread? != false) # callback begin - ret = cmd.call(*args) + ret = cmd.call(safe_level, *args) rescue SystemExit => e # exit IP warn("Warning: "+ $! + " on " + self.inspect) if $DEBUG @@ -1492,36 +1492,12 @@ class MultiTkIp end private :eval_proc_core -=begin - def eval_callback(*args) - if block_given? - eval_proc_core(false, proc{$SAFE=@safe_level[0]; Proc.new}.call, *args) - else - eval_proc_core(false, *args) - end - end -=end -=begin - def eval_callback(*args) - if block_given? - eval_proc_core(false, Proc.new, *args) -# eval_proc_core(Thread.current, Proc.new, *args) - else - cmd = args.shift - eval_proc_core(false, *args) -# eval_proc_core(Thread.current, *args) - end - end -=end def eval_callback(*args) if block_given? cmd = Proc.new else cmd = args.shift end - if TclTkLib.mainloop_thread? != false - args.unshift(safe_level) - end current = Thread.current backup_ip = current['callback_ip'] current['callback_ip'] = self @@ -1532,15 +1508,6 @@ class MultiTkIp end end -=begin - def eval_proc(*args) - if block_given? - eval_proc_core(true, proc{$SAFE=@safe_level[0]; Proc.new}.call, *args) - else - eval_proc_core(true, *args) - end - end -=end def eval_proc(*args) # The scope of the eval-block of 'eval_proc' method is different from # the external. If you want to pass local values to the eval-block, @@ -1562,7 +1529,7 @@ class MultiTkIp proc{|safe, *params| $SAFE=safe if $SAFE < safe cmd.call(*params) - }, safe_level, *args) + }, *args) ensure current['callback_ip'] = backup_ip end @@ -1572,7 +1539,7 @@ class MultiTkIp $SAFE=safe if $SAFE < safe Thread.new(*params, &cmd).value }, - safe_level, *args) + *args) end end alias call eval_proc @@ -1636,28 +1603,10 @@ end class << MultiTkIp # class method -=begin - def eval_proc(cmd = proc{$SAFE=__getip.safe_level; Proc.new}.call, *args) - # class ==> interp object - __getip.eval_proc(cmd, *args) - end -=end -=begin - def eval_proc(*args) - # class ==> interp object - if block_given? - __getip.eval_proc(proc{$SAFE=__getip.safe_level; Proc.new}.call, *args) - else - __getip.eval_proc(*args) - end - end -=end -#=begin def eval_proc(*args, &blk) # class ==> interp object __getip.eval_proc(*args, &blk) end -#=end alias call eval_proc alias eval_string eval_proc end @@ -2059,8 +2008,10 @@ class MultiTkIp =end begin # subip._eval_without_enc("foreach i [after info] {after cancel $i}") - after_ids = subip._eval_without_enc("after info") - subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}") + unless subip.deleted? + after_ids = subip._eval_without_enc("after info") + subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}") + end rescue Exception end diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 9f6290952e..174d34ceaa 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -4199,7 +4199,7 @@ end #Tk.freeze module Tk - RELEASE_DATE = '2005-07-22'.freeze + RELEASE_DATE = '2005-07-25'.freeze autoload :AUTO_PATH, 'tk/variable' autoload :TCL_PACKAGE_PATH, 'tk/variable' -- cgit v1.2.3