diff options
Diffstat (limited to 'ext/tk/lib/tkextlib/bwidget/listbox.rb')
-rw-r--r-- | ext/tk/lib/tkextlib/bwidget/listbox.rb | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb index 9f505703f2..7f218c923c 100644 --- a/ext/tk/lib/tkextlib/bwidget/listbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb @@ -44,13 +44,33 @@ class Tk::BWidget::ListBox end end - def imagebind(*args) - _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args) + #def imagebind(*args) + # _bind_for_event_class(Event_for_Items, [path, 'bindImage'], *args) + # self + #end + def imagebind(context, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + _bind_for_event_class(Event_for_Items, [path, 'bindImage'], + context, cmd, *args) self end - def imagebind_append(*args) - _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args) + #def imagebind_append(*args) + # _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], *args) + # self + #end + def imagebind_append(context, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + _bind_append_for_event_class(Event_for_Items, [path, 'bindImage'], + context, cmd, *args) self end @@ -63,13 +83,33 @@ class Tk::BWidget::ListBox _bindinfo_for_event_class(Event_for_Items, [path, 'bindImage'], *args) end - def textbind(*args) - _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args) + #def textbind(*args) + # _bind_for_event_class(Event_for_Items, [path, 'bindText'], *args) + # self + #end + def textbind(context, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + _bind_for_event_class(Event_for_Items, [path, 'bindText'], + context, cmd, *args) self end - def textbind_append(*args) - _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args) + #def textbind_append(*args) + # _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], *args) + # self + #end + def textbind_append(context, *args) + if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + cmd = args.shift + else + cmd = Proc.new + end + _bind_append_for_event_class(Event_for_Items, [path, 'bindText'], + context, cmd, *args) self end |