summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-25 05:11:19 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-25 05:11:19 +0000
commit4af6b52fc0bab9a6cce42a148bcdc0853a777544 (patch)
tree6e0f37848e6812b0de5b0c797a911dad246abb72 /ext
parentad1bc6c322f90466b6cd57f528ec620cabbaf6da (diff)
* ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/multi-tk.rb63
-rw-r--r--ext/tk/lib/tk.rb2
2 files changed, 8 insertions, 57 deletions
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'