diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/treectrl/tktreectrl.rb')
-rw-r--r-- | ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index 729007edfb..11f723a8ff 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -743,16 +743,39 @@ class Tk::TreeCtrl marquee_visible() end - def notify_bind(obj, event, cmd=Proc.new, *args) + #def notify_bind(obj, event, cmd=Proc.new, *args) + # _bind([@path, 'notify', 'bind', obj], event, cmd, *args) + # self + #end + def notify_bind(obj, event, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end _bind([@path, 'notify', 'bind', obj], event, cmd, *args) self end - def notify_bind_append(obj, event, cmd=Proc.new, *args) + #def notify_bind_append(obj, event, cmd=Proc.new, *args) + # _bind([@path, 'notify', 'bind', obj], event, cmd, *args) + # self + #end + def notify_bind_append(obj, event, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end _bind([@path, 'notify', 'bind', obj], event, cmd, *args) self end + def notify_bindremove(obj, event) + _bind_remove([@path, 'notify', 'bind', obj], event) + self + end + def notify_bindinfo(obj, event=nil) _bindinfo([@path, 'notify', 'bind', obj], event) end |