summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-03 09:40:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-03 09:40:21 +0000
commitc5fc4bca6d45ac58be7ccba26fbb90664643eab3 (patch)
tree0d0876c684f83c9a662bcc1000e7150404ba53f8 /ext
parent63ae7e1c1351da7cd7291e417ba559098ee5c715 (diff)
* eval.c (rb_call_super): inheritance line adjustment moved from
rb_call(). [ruby-core:01113] * eval.c (rb_eval): use rb_call_super() to follow DRY principle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/lib/tk.rb28
-rw-r--r--ext/tk/lib/tkcanvas.rb6
-rw-r--r--ext/tk/lib/tkentry.rb2
-rw-r--r--ext/tk/lib/tktext.rb10
4 files changed, 23 insertions, 23 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb
index b908aaa240..701392c875 100644
--- a/ext/tk/lib/tk.rb
+++ b/ext/tk/lib/tk.rb
@@ -441,11 +441,11 @@ module TkComm
private :install_bind, :tk_event_sequence,
:_bind_core, :_bind, :_bind_append, :_bind_remove, :_bindinfo
- def bind(tagOrClass, context, cmd=Proc.new, args=nil)
+ def bind(tagOrClass, context, cmd=Block.new, args=nil)
_bind(["bind", tagOrClass], context, cmd, args)
end
- def bind_append(tagOrClass, context, cmd=Proc.new, args=nil)
+ def bind_append(tagOrClass, context, cmd=Block.new, args=nil)
_bind_append(["bind", tagOrClass], context, cmd, args)
end
@@ -457,11 +457,11 @@ module TkComm
_bindinfo(['bind', tagOrClass], context)
end
- def bind_all(context, cmd=Proc.new, args=nil)
+ def bind_all(context, cmd=Block.new, args=nil)
_bind(['bind', 'all'], context, cmd, args)
end
- def bind_append_all(context, cmd=Proc.new, args=nil)
+ def bind_append_all(context, cmd=Block.new, args=nil)
_bind_append(['bind', 'all'], context, cmd, args)
end
@@ -513,7 +513,7 @@ module TkCore
fail TkCallbackContinue, "Tk callback returns 'continue' status"
end
- def after(ms, cmd=Proc.new)
+ def after(ms, cmd=Block.new)
myid = _curr_cmd_id
cmdid = install_cmd(cmd)
tk_call("after",ms,cmdid)
@@ -531,7 +531,7 @@ module TkCore
# end
end
- def after_idle(cmd=Proc.new)
+ def after_idle(cmd=Block.new)
myid = _curr_cmd_id
cmdid = install_cmd(cmd)
tk_call('after','idle',cmdid)
@@ -871,10 +871,10 @@ module Tk
end
module Scrollable
- def xscrollcommand(cmd=Proc.new)
+ def xscrollcommand(cmd=Block.new)
configure_cmd 'xscrollcommand', cmd
end
- def yscrollcommand(cmd=Proc.new)
+ def yscrollcommand(cmd=Block.new)
configure_cmd 'yscrollcommand', cmd
end
def xview(*index)
@@ -1103,11 +1103,11 @@ else
end
module TkBindCore
- def bind(context, cmd=Proc.new, args=nil)
+ def bind(context, cmd=Block.new, args=nil)
Tk.bind(to_eval, context, cmd, args)
end
- def bind_append(context, cmd=Proc.new, args=nil)
+ def bind_append(context, cmd=Block.new, args=nil)
Tk.bind_append(to_eval, context, cmd, args)
end
@@ -2161,7 +2161,7 @@ module TkOption
proc_str = TkOption.get(self::CARRIER, id.id2name, '')
proc_str = '{' + proc_str + '}' unless /\A\{.*\}\Z/ =~ proc_str
proc_str = __check_proc_string__(proc_str)
- res_proc = eval 'Proc.new' + proc_str
+ res_proc = eval 'Block.new' + proc_str
self::METHOD_TBL[id] = res_proc
end
proc{
@@ -2840,7 +2840,7 @@ class TkWindow<TkObject
self
end
- def command(cmd=Proc.new)
+ def command(cmd=Block.new)
configure_cmd 'command', cmd
end
@@ -3458,10 +3458,10 @@ class TkMenu<TkWindow
def postcascade(index)
tk_send 'postcascade', index
end
- def postcommand(cmd=Proc.new)
+ def postcommand(cmd=Block.new)
configure_cmd 'postcommand', cmd
end
- def tearoffcommand(cmd=Proc.new)
+ def tearoffcommand(cmd=Block.new)
configure_cmd 'tearoffcommand', cmd
end
def menutype(index)
diff --git a/ext/tk/lib/tkcanvas.rb b/ext/tk/lib/tkcanvas.rb
index 4a5e4b45bb..7f0fba13ec 100644
--- a/ext/tk/lib/tkcanvas.rb
+++ b/ext/tk/lib/tkcanvas.rb
@@ -81,11 +81,11 @@ class TkCanvas<TkWindow
list(tk_send('bbox', tagid(tagOrId), *tags.collect{|t| tagid(t)}))
end
- def itembind(tag, context, cmd=Proc.new, args=nil)
+ def itembind(tag, context, cmd=Block.new, args=nil)
_bind([path, "bind", tagid(tag)], context, cmd, args)
end
- def itembind_append(tag, context, cmd=Proc.new, args=nil)
+ def itembind_append(tag, context, cmd=Block.new, args=nil)
_bind_append([path, "bind", tagid(tag)], context, cmd, args)
end
@@ -346,7 +346,7 @@ module TkcTagAccess
@c.bbox(@id)
end
- def bind(seq, cmd=Proc.new, args=nil)
+ def bind(seq, cmd=Block.new, args=nil)
@c.itembind @id, seq, cmd, args
end
diff --git a/ext/tk/lib/tkentry.rb b/ext/tk/lib/tkentry.rb
index 2772dfd676..f95fdf340d 100644
--- a/ext/tk/lib/tkentry.rb
+++ b/ext/tk/lib/tkentry.rb
@@ -38,7 +38,7 @@ class TkEntry<TkLabel
attr :widget
end
- def initialize(cmd = Proc.new, args=nil)
+ def initialize(cmd = Block.new, args=nil)
if args
@id = install_cmd(proc{|*arg|
TkUtil.eval_cmd cmd, *arg
diff --git a/ext/tk/lib/tktext.rb b/ext/tk/lib/tktext.rb
index dd4d649042..2db9a22bdf 100644
--- a/ext/tk/lib/tktext.rb
+++ b/ext/tk/lib/tktext.rb
@@ -172,11 +172,11 @@ class TkText<TkTextWin
tk_send 'tag', 'add', tag, index1, index2
end
- def tag_bind(tag, seq, cmd=Proc.new, args=nil)
+ def tag_bind(tag, seq, cmd=Block.new, args=nil)
_bind(['tag', 'bind', tag], seq, cmd, args)
end
- def tag_bind_append(tag, seq, cmd=Proc.new, args=nil)
+ def tag_bind_append(tag, seq, cmd=Block.new, args=nil)
_bind_append(['tag', 'bind', tag], seq, cmd, args)
end
@@ -419,7 +419,7 @@ class TkText<TkTextWin
def dump(type_info, *index, &block)
args = type_info.collect{|inf| '-' + inf}
- args << '-command' << Proc.new(&block) if iterator?
+ args << '-command' << block if block
str = tk_send('dump', *(args + index))
result = []
sel = nil
@@ -663,11 +663,11 @@ class TkTextTag<TkObject
@t.tag_configinfo @id, key
end
- def bind(seq, cmd=Proc.new, args=nil)
+ def bind(seq, cmd=Block.new, args=nil)
_bind([@t.path, 'tag', 'bind', @id], seq, cmd, args)
end
- def bind_append(seq, cmd=Proc.new, args=nil)
+ def bind_append(seq, cmd=Block.new, args=nil)
_bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, args)
end