mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
4cbaddcf8c
commit
c2ac862f1a
10 changed files with 98 additions and 74 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
Sun Nov 7 23:49:26 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* 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 <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* ext/win32ole/win32ole.c: rename WIN32OLE#ole_obj_help to
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
2004-11-07 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* 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 <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* SUPPORT_STATUS: BLT moves to 'plan to support' from 'not determined'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue