From c2ac862f1a3a1d387f65d4cd6342b4a836b03893 Mon Sep 17 00:00:00 2001 From: nagai Date: Sun, 7 Nov 2004 14:53:02 +0000 Subject: [PATCH] * ext/tk/lib/tk.rb: bind-event methods accept multi substitution arguments. * ext/tk/lib/tk/canvas.rb: ditto. * ext/tk/lib/tk/canvastag.rb: ditto. * ext/tk/lib/tk/text.rb: ditto. * ext/tk/lib/tk/texttag.rb: ditto. * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: ditto. * ext/tk/lib/tkextlib/tktable/tktable.rb: ditto. * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 15 ++++++ ext/tk/ChangeLog.tkextlib | 9 ++++ ext/tk/lib/tk.rb | 48 ++++++++--------- ext/tk/lib/tk/canvas.rb | 8 +-- ext/tk/lib/tk/canvastag.rb | 52 +++++++++---------- ext/tk/lib/tk/text.rb | 8 +-- ext/tk/lib/tk/texttag.rb | 8 +-- .../lib/tkextlib/iwidgets/scrolledcanvas.rb | 8 +-- ext/tk/lib/tkextlib/tktable/tktable.rb | 8 +-- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 8 +-- 10 files changed, 98 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45bceaab5f..11224770ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI + + * ext/tk/lib/tk.rb: bind-event methods accept multi substitution + arguments. + + * ext/tk/lib/tk/canvas.rb: ditto. + + * ext/tk/lib/tk/canvastag.rb: ditto. + + * ext/tk/lib/tk/text.rb: ditto. + + * ext/tk/lib/tk/texttag.rb: ditto. + + * ext/tk/lib/tkextlib: ditto. + Sat Nov 6 20:40:16 2004 Masaki Suketa * ext/win32ole/win32ole.c: rename WIN32OLE#ole_obj_help to diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib index 6386f727f6..25f4469101 100644 --- a/ext/tk/ChangeLog.tkextlib +++ b/ext/tk/ChangeLog.tkextlib @@ -1,3 +1,12 @@ +2004-11-07 Hidetoshi NAGAI + + * ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb: + bind-event methods accept multi substitution arguments. + + * ext/tk/lib/tkextlib/tktable/tktable.rb: ditto. + + * ext/tk/lib/tkextlib/treectrl/tktreectrl.rb: ditto + 2004-11-03 Hidetoshi NAGAI * SUPPORT_STATUS: BLT moves to 'plan to support' from 'not determined' diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 807ccd2285..ea9f0749f5 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -818,8 +818,8 @@ module TkComm end end - def _bind_core(mode, what, context, cmd, args=nil) - id = install_bind(cmd, args) if cmd + def _bind_core(mode, what, context, cmd, *args) + id = install_bind(cmd, *args) if cmd begin tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", mode + id])) @@ -829,12 +829,12 @@ module TkComm end end - def _bind(what, context, cmd, args=nil) - _bind_core('', what, context, cmd, args) + def _bind(what, context, cmd, *args) + _bind_core('', what, context, cmd, *args) end - def _bind_append(what, context, cmd, args=nil) - _bind_core('+', what, context, cmd, args) + def _bind_append(what, context, cmd, *args) + _bind_core('+', what, context, cmd, *args) end def _bind_remove(what, context) @@ -868,8 +868,8 @@ module TkComm end end - def _bind_core_for_event_class(klass, mode, what, context, cmd, args=nil) - id = install_bind_for_event_class(klass, cmd, args) if cmd + def _bind_core_for_event_class(klass, mode, what, context, cmd, *args) + id = install_bind_for_event_class(klass, cmd, *args) if cmd begin tk_call_without_enc(*(what + ["<#{tk_event_sequence(context)}>", mode + id])) @@ -879,12 +879,12 @@ module TkComm end end - def _bind_for_event_class(klass, what, context, cmd, args=nil) - _bind_core_for_event_class(klass, '', what, context, cmd, args) + def _bind_for_event_class(klass, what, context, cmd, *args) + _bind_core_for_event_class(klass, '', what, context, cmd, *args) end - def _bind_append_for_event_class(klass, what, context, cmd, args=nil) - _bind_core_for_event_class(klass, '+', what, context, cmd, args) + def _bind_append_for_event_class(klass, what, context, cmd, *args) + _bind_core_for_event_class(klass, '+', what, context, cmd, *args) end def _bind_remove_for_event_class(klass, what, context) @@ -901,13 +901,13 @@ module TkComm :_bind_append_for_event_class, :_bind_remove_for_event_class, :_bindinfo_for_event_class - def bind(tagOrClass, context, cmd=Proc.new, args=nil) - _bind(["bind", tagOrClass], context, cmd, args) + def bind(tagOrClass, context, cmd=Proc.new, *args) + _bind(["bind", tagOrClass], context, cmd, *args) tagOrClass end - def bind_append(tagOrClass, context, cmd=Proc.new, args=nil) - _bind_append(["bind", tagOrClass], context, cmd, args) + def bind_append(tagOrClass, context, cmd=Proc.new, *args) + _bind_append(["bind", tagOrClass], context, cmd, *args) tagOrClass end @@ -920,13 +920,13 @@ module TkComm _bindinfo(['bind', tagOrClass], context) end - def bind_all(context, cmd=Proc.new, args=nil) - _bind(['bind', 'all'], context, cmd, args) + def bind_all(context, cmd=Proc.new, *args) + _bind(['bind', 'all'], context, cmd, *args) TkBindTag::ALL end - def bind_append_all(context, cmd=Proc.new, args=nil) - _bind_append(['bind', 'all'], context, cmd, args) + def bind_append_all(context, cmd=Proc.new, *args) + _bind_append(['bind', 'all'], context, cmd, *args) TkBindTag::ALL end @@ -2060,12 +2060,12 @@ end module TkBindCore - def bind(context, cmd=Proc.new, args=nil) - Tk.bind(self, context, cmd, args) + def bind(context, cmd=Proc.new, *args) + Tk.bind(self, context, cmd, *args) end - def bind_append(context, cmd=Proc.new, args=nil) - Tk.bind_append(self, context, cmd, args) + def bind_append(context, cmd=Proc.new, *args) + Tk.bind_append(self, context, cmd, *args) end def bind_remove(context) diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb index 1a8a7927d3..9a042155e3 100644 --- a/ext/tk/lib/tk/canvas.rb +++ b/ext/tk/lib/tk/canvas.rb @@ -94,13 +94,13 @@ class TkCanvas