diff options
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r-- | ext/tk/lib/tk.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index ec1ee8f8c0..cefb87400a 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -443,11 +443,11 @@ module TkComm private :install_bind, :tk_event_sequence, :_bind_core, :_bind, :_bind_append, :_bind_remove, :_bindinfo - def bind(tagOrClass, context, cmd=Block.new, args=nil) + def bind(tagOrClass, context, cmd=Proc.new, args=nil) _bind(["bind", tagOrClass], context, cmd, args) end - def bind_append(tagOrClass, context, cmd=Block.new, args=nil) + def bind_append(tagOrClass, context, cmd=Proc.new, args=nil) _bind_append(["bind", tagOrClass], context, cmd, args) end @@ -459,11 +459,11 @@ module TkComm _bindinfo(['bind', tagOrClass], context) end - def bind_all(context, cmd=Block.new, args=nil) + def bind_all(context, cmd=Proc.new, args=nil) _bind(['bind', 'all'], context, cmd, args) end - def bind_append_all(context, cmd=Block.new, args=nil) + def bind_append_all(context, cmd=Proc.new, args=nil) _bind_append(['bind', 'all'], context, cmd, args) end @@ -515,7 +515,7 @@ module TkCore fail TkCallbackContinue, "Tk callback returns 'continue' status" end - def after(ms, cmd=Block.new) + def after(ms, cmd=Proc.new) myid = _curr_cmd_id cmdid = install_cmd(cmd) tk_call("after",ms,cmdid) @@ -533,7 +533,7 @@ module TkCore # end end - def after_idle(cmd=Block.new) + def after_idle(cmd=Proc.new) myid = _curr_cmd_id cmdid = install_cmd(cmd) tk_call('after','idle',cmdid) @@ -873,10 +873,10 @@ module Tk end module Scrollable - def xscrollcommand(cmd=Block.new) + def xscrollcommand(cmd=Proc.new) configure_cmd 'xscrollcommand', cmd end - def yscrollcommand(cmd=Block.new) + def yscrollcommand(cmd=Proc.new) configure_cmd 'yscrollcommand', cmd end def xview(*index) @@ -1105,11 +1105,11 @@ else end module TkBindCore - def bind(context, cmd=Block.new, args=nil) + def bind(context, cmd=Proc.new, args=nil) Tk.bind(to_eval, context, cmd, args) end - def bind_append(context, cmd=Block.new, args=nil) + def bind_append(context, cmd=Proc.new, args=nil) Tk.bind_append(to_eval, context, cmd, args) end @@ -2163,7 +2163,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 'Block.new' + proc_str + res_proc = eval 'Proc.new' + proc_str self::METHOD_TBL[id] = res_proc end proc{ @@ -2857,7 +2857,7 @@ class TkWindow<TkObject self end - def command(cmd=Block.new) + def command(cmd=Proc.new) configure_cmd 'command', cmd end @@ -3475,10 +3475,10 @@ class TkMenu<TkWindow def postcascade(index) tk_send 'postcascade', index end - def postcommand(cmd=Block.new) + def postcommand(cmd=Proc.new) configure_cmd 'postcommand', cmd end - def tearoffcommand(cmd=Block.new) + def tearoffcommand(cmd=Proc.new) configure_cmd 'tearoffcommand', cmd end def menutype(index) |