diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/tk/ChangeLog.tkextlib | 9 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 48 | ||||
-rw-r--r-- | ext/tk/lib/tk/canvas.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tk/canvastag.rb | 52 | ||||
-rw-r--r-- | ext/tk/lib/tk/text.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tk/texttag.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/tktable/tktable.rb | 8 | ||||
-rw-r--r-- | ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 8 |
9 files changed, 83 insertions, 74 deletions
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 <[email protected]> + + * 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 <[email protected]> * 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<TkWindow *tags.collect{|t| tagid(t)})) end - def itembind(tag, context, cmd=Proc.new, args=nil) - _bind([path, "bind", tagid(tag)], context, cmd, args) + def itembind(tag, context, cmd=Proc.new, *args) + _bind([path, "bind", tagid(tag)], context, cmd, *args) self end - def itembind_append(tag, context, cmd=Proc.new, args=nil) - _bind_append([path, "bind", tagid(tag)], context, cmd, args) + def itembind_append(tag, context, cmd=Proc.new, *args) + _bind_append([path, "bind", tagid(tag)], context, cmd, *args) self end diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb index f27111bd84..3d5c6703d2 100644 --- a/ext/tk/lib/tk/canvastag.rb +++ b/ext/tk/lib/tk/canvastag.rb @@ -21,31 +21,31 @@ module TkcTagAccess @c.bbox(@id) end - def bind(seq, cmd=Proc.new, args=nil) - @c.itembind @id, seq, cmd, args + def bind(seq, cmd=Proc.new, *args) + @c.itembind(@id, seq, cmd, *args) self end - def bind_append(seq, cmd=Proc.new, args=nil) - @c.itembind_append @id, seq, cmd, args + def bind_append(seq, cmd=Proc.new, *args) + @c.itembind_append(@id, seq, cmd, *args) self end def bind_remove(seq) - @c.itembind_remove @id, seq + @c.itembind_remove(@id, seq) self end def bindinfo(seq=nil) - @c.itembindinfo @id, seq + @c.itembindinfo(@id, seq) end def cget(option) - @c.itemcget @id, option + @c.itemcget(@id, option) end def configure(key, value=None) - @c.itemconfigure @id, key, value + @c.itemconfigure(@id, key, value) self end # def configure(keys) @@ -53,71 +53,71 @@ module TkcTagAccess # end def configinfo(key=nil) - @c.itemconfiginfo @id, key + @c.itemconfiginfo(@id, key) end def current_configinfo(key=nil) - @c.current_itemconfiginfo @id, key + @c.current_itemconfiginfo(@id, key) end def coords(*args) - @c.coords @id, *args + @c.coords(@id, *args) end def dchars(first, last=None) - @c.dchars @id, first, last + @c.dchars(@id, first, last) self end def dtag(tag_to_del=None) - @c.dtag @id, tag_to_del + @c.dtag(@id, tag_to_del) self end def find - @c.find 'withtag', @id + @c.find('withtag', @id) end alias list find def focus - @c.itemfocus @id + @c.itemfocus(@id) end def gettags - @c.gettags @id + @c.gettags(@id) end def icursor(index) - @c.icursor @id, index + @c.icursor(@id, index) self end def index(index) - @c.index @id, index + @c.index(@id, index) end def insert(beforethis, string) - @c.insert @id, beforethis, string + @c.insert(@id, beforethis, string) self end def lower(belowthis=None) - @c.lower @id, belowthis + @c.lower(@id, belowthis) self end def move(xamount, yamount) - @c.move @id, xamount, yamount + @c.move(@id, xamount, yamount) self end def raise(abovethis=None) - @c.raise @id, abovethis + @c.raise(@id, abovethis) self end def scale(xorigin, yorigin, xscale, yscale) - @c.scale @id, xorigin, yorigin, xscale, yscale + @c.scale(@id, xorigin, yorigin, xscale, yscale) self end @@ -135,7 +135,7 @@ module TkcTagAccess end def itemtype - @c.itemtype @id + @c.itemtype(@id) end # Following operators support logical expressions of canvas tags @@ -337,14 +337,14 @@ class TkcGroup<TkcTag def include(*tags) for i in tags - i.addtag @id + i.addtag(@id) end self end def exclude(*tags) for i in tags - i.delete @id + i.delete(@id) end self end diff --git a/ext/tk/lib/tk/text.rb b/ext/tk/lib/tk/text.rb index efede9861f..fbe1c08c76 100644 --- a/ext/tk/lib/tk/text.rb +++ b/ext/tk/lib/tk/text.rb @@ -519,13 +519,13 @@ class TkText<TkTextWin alias deltag tag_delete alias delete_tag tag_delete - def tag_bind(tag, seq, cmd=Proc.new, args=nil) - _bind([@path, 'tag', 'bind', tag], seq, cmd, args) + def tag_bind(tag, seq, cmd=Proc.new, *args) + _bind([@path, 'tag', 'bind', tag], seq, cmd, *args) self end - def tag_bind_append(tag, seq, cmd=Proc.new, args=nil) - _bind_append([@path, 'tag', 'bind', tag], seq, cmd, args) + def tag_bind_append(tag, seq, cmd=Proc.new, *args) + _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args) self end diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb index d2611509a4..78f7469869 100644 --- a/ext/tk/lib/tk/texttag.rb +++ b/ext/tk/lib/tk/texttag.rb @@ -162,13 +162,13 @@ class TkTextTag<TkObject @t.current_tag_configinfo @id, key end - def bind(seq, cmd=Proc.new, args=nil) - _bind([@t.path, 'tag', 'bind', @id], seq, cmd, args) + def bind(seq, cmd=Proc.new, *args) + _bind([@t.path, 'tag', 'bind', @id], seq, cmd, *args) self end - def bind_append(seq, cmd=Proc.new, args=nil) - _bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, args) + def bind_append(seq, cmd=Proc.new, *args) + _bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, *args) self end diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb index c26eda1586..f3c4260482 100644 --- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb +++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb @@ -97,13 +97,13 @@ class Tk::Iwidgets::Scrolledcanvas *tags.collect{|t| tagid(t)})) end - def itembind(tag, context, cmd=Proc.new, args=nil) - _bind([path, "bind", tagid(tag)], context, cmd, args) + def itembind(tag, context, cmd=Proc.new, *args) + _bind([path, "bind", tagid(tag)], context, cmd, *args) self end - def itembind_append(tag, context, cmd=Proc.new, args=nil) - _bind_append([path, "bind", tagid(tag)], context, cmd, args) + def itembind_append(tag, context, cmd=Proc.new, *args) + _bind_append([path, "bind", tagid(tag)], context, cmd, *args) self end diff --git a/ext/tk/lib/tkextlib/tktable/tktable.rb b/ext/tk/lib/tkextlib/tktable/tktable.rb index 2f2b14a69f..7182983c04 100644 --- a/ext/tk/lib/tkextlib/tktable/tktable.rb +++ b/ext/tk/lib/tkextlib/tktable/tktable.rb @@ -61,10 +61,10 @@ module Tk::TkTable::ConfigMethod itemconfigure(['tag', tagid(tagOrId)], slot, value) end def tag_configinfo(tagOrId, slot=nil) - itemconfigure(['tag', tagid(tagOrId)], slot) + itemconfiginfo(['tag', tagid(tagOrId)], slot) end def current_tag_configinfo(tagOrId, slot=nil) - itemconfigure(['tag', tagid(tagOrId)], slot) + current_itemconfiginfo(['tag', tagid(tagOrId)], slot) end def window_cget(tagOrId, option) @@ -74,10 +74,10 @@ module Tk::TkTable::ConfigMethod itemconfigure(['window', tagid(tagOrId)], slot, value) end def window_configinfo(tagOrId, slot=nil) - itemconfigure(['window', tagid(tagOrId)], slot) + itemconfiginfo(['window', tagid(tagOrId)], slot) end def current_window_configinfo(tagOrId, slot=nil) - itemconfigure(['window', tagid(tagOrId)], slot) + current_itemconfiginfo(['window', tagid(tagOrId)], slot) end private :itemcget, :itemconfigure diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index cc23857c5f..729007edfb 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -743,13 +743,13 @@ class Tk::TreeCtrl marquee_visible() end - def notify_bind(obj, event, cmd=Proc.new, args=nil) - _bind([@path, 'notify', 'bind', obj], event, cmd, args) + def notify_bind(obj, event, cmd=Proc.new, *args) + _bind([@path, 'notify', 'bind', obj], event, cmd, *args) self end - def notify_bind_append(obj, event, cmd=Proc.new, args=nil) - _bind([@path, 'notify', 'bind', obj], event, cmd, args) + def notify_bind_append(obj, event, cmd=Proc.new, *args) + _bind([@path, 'notify', 'bind', obj], event, cmd, *args) self end |