mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
73efe6b783
commit
b535e9b004
3 changed files with 12 additions and 57 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Jul 25 14:10:02 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/lib/multi-tk.rb: fix en-bugged part in the last commit.
|
||||||
|
|
||||||
Sat Jul 23 16:48:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
Sat Jul 23 16:48:12 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
|
* ext/openssl/ossl_engine.c (ossl_engine_s_load): should check
|
||||||
|
|
|
@ -1411,7 +1411,7 @@ class MultiTkIp
|
||||||
if @cmd_receiver == Thread.current ||
|
if @cmd_receiver == Thread.current ||
|
||||||
(!req_val && TclTkLib.mainloop_thread? != false) # callback
|
(!req_val && TclTkLib.mainloop_thread? != false) # callback
|
||||||
begin
|
begin
|
||||||
ret = cmd.call(*args)
|
ret = cmd.call(safe_level, *args)
|
||||||
rescue SystemExit => e
|
rescue SystemExit => e
|
||||||
# exit IP
|
# exit IP
|
||||||
warn("Warning: "+ $! + " on " + self.inspect) if $DEBUG
|
warn("Warning: "+ $! + " on " + self.inspect) if $DEBUG
|
||||||
|
@ -1492,36 +1492,12 @@ class MultiTkIp
|
||||||
end
|
end
|
||||||
private :eval_proc_core
|
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)
|
def eval_callback(*args)
|
||||||
if block_given?
|
if block_given?
|
||||||
cmd = Proc.new
|
cmd = Proc.new
|
||||||
else
|
else
|
||||||
cmd = args.shift
|
cmd = args.shift
|
||||||
end
|
end
|
||||||
if TclTkLib.mainloop_thread? != false
|
|
||||||
args.unshift(safe_level)
|
|
||||||
end
|
|
||||||
current = Thread.current
|
current = Thread.current
|
||||||
backup_ip = current['callback_ip']
|
backup_ip = current['callback_ip']
|
||||||
current['callback_ip'] = self
|
current['callback_ip'] = self
|
||||||
|
@ -1532,15 +1508,6 @@ class MultiTkIp
|
||||||
end
|
end
|
||||||
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)
|
def eval_proc(*args)
|
||||||
# The scope of the eval-block of 'eval_proc' method is different from
|
# 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,
|
# the external. If you want to pass local values to the eval-block,
|
||||||
|
@ -1562,7 +1529,7 @@ class MultiTkIp
|
||||||
proc{|safe, *params|
|
proc{|safe, *params|
|
||||||
$SAFE=safe if $SAFE < safe
|
$SAFE=safe if $SAFE < safe
|
||||||
cmd.call(*params)
|
cmd.call(*params)
|
||||||
}, safe_level, *args)
|
}, *args)
|
||||||
ensure
|
ensure
|
||||||
current['callback_ip'] = backup_ip
|
current['callback_ip'] = backup_ip
|
||||||
end
|
end
|
||||||
|
@ -1572,7 +1539,7 @@ class MultiTkIp
|
||||||
$SAFE=safe if $SAFE < safe
|
$SAFE=safe if $SAFE < safe
|
||||||
Thread.new(*params, &cmd).value
|
Thread.new(*params, &cmd).value
|
||||||
},
|
},
|
||||||
safe_level, *args)
|
*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
alias call eval_proc
|
alias call eval_proc
|
||||||
|
@ -1636,28 +1603,10 @@ end
|
||||||
|
|
||||||
class << MultiTkIp
|
class << MultiTkIp
|
||||||
# class method
|
# 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)
|
def eval_proc(*args, &blk)
|
||||||
# class ==> interp object
|
# class ==> interp object
|
||||||
__getip.eval_proc(*args, &blk)
|
__getip.eval_proc(*args, &blk)
|
||||||
end
|
end
|
||||||
#=end
|
|
||||||
alias call eval_proc
|
alias call eval_proc
|
||||||
alias eval_string eval_proc
|
alias eval_string eval_proc
|
||||||
end
|
end
|
||||||
|
@ -2059,8 +2008,10 @@ class MultiTkIp
|
||||||
=end
|
=end
|
||||||
begin
|
begin
|
||||||
# subip._eval_without_enc("foreach i [after info] {after cancel $i}")
|
# subip._eval_without_enc("foreach i [after info] {after cancel $i}")
|
||||||
after_ids = subip._eval_without_enc("after info")
|
unless subip.deleted?
|
||||||
subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
|
after_ids = subip._eval_without_enc("after info")
|
||||||
|
subip._eval_without_enc("foreach i {#{after_ids}} {after cancel $i}")
|
||||||
|
end
|
||||||
rescue Exception
|
rescue Exception
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -4199,7 +4199,7 @@ end
|
||||||
#Tk.freeze
|
#Tk.freeze
|
||||||
|
|
||||||
module Tk
|
module Tk
|
||||||
RELEASE_DATE = '2005-07-22'.freeze
|
RELEASE_DATE = '2005-07-25'.freeze
|
||||||
|
|
||||||
autoload :AUTO_PATH, 'tk/variable'
|
autoload :AUTO_PATH, 'tk/variable'
|
||||||
autoload :TCL_PACKAGE_PATH, 'tk/variable'
|
autoload :TCL_PACKAGE_PATH, 'tk/variable'
|
||||||
|
|
Loading…
Reference in a new issue