From 9e51ec666b367a8bca102d8f858173cc7ed56e12 Mon Sep 17 00:00:00 2001 From: nagai Date: Thu, 16 Dec 2004 07:13:14 +0000 Subject: [PATCH] * ext/tk/lib/tk/bindtag.rb: bug fix [ruby-talk: 123667] * ext/tk/lib/tk/timer.rb: accept :idle for the interval argument * ext/tk/lib/tk.rb: add TkComm._callback_entry?() * ext/tk/lib/multi-tk.rb: add MultiTkIp.cb_entry_class * ext/tk/lib/tk/canvas.rb: use TkComm._callback_entry?() * ext/tk/lib/tk/canvastag.rb: ditto * ext/tk/lib/tk/dialog.rb: ditto * ext/tk/lib/tk/optiondb.rb: ditto * ext/tk/lib/tk/text.rb: ditto * ext/tk/lib/tk/texttag.rb: ditto * ext/tk/lib/tk/textwindow.rb: ditto * ext/tk/lib/tk/timer.rb: ditto * ext/tk/lib/tk/validation.rb: ditto * ext/tk/lib/tkextlib/*: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/tk/ChangeLog.tkextlib | 24 ++++++++++++ ext/tk/lib/multi-tk.rb | 3 ++ ext/tk/lib/tk.rb | 24 +++++++++--- ext/tk/lib/tk/bindtag.rb | 3 +- ext/tk/lib/tk/canvas.rb | 6 ++- ext/tk/lib/tk/canvastag.rb | 6 ++- ext/tk/lib/tk/dialog.rb | 31 +++++++-------- ext/tk/lib/tk/optiondb.rb | 7 ++-- ext/tk/lib/tk/text.rb | 38 ++++++++++--------- ext/tk/lib/tk/texttag.rb | 22 ++++++----- ext/tk/lib/tk/textwindow.rb | 10 +++-- ext/tk/lib/tk/timer.rb | 33 ++++++++++------ ext/tk/lib/tk/validation.rb | 6 ++- ext/tk/lib/tkextlib/bwidget/labelentry.rb | 6 ++- ext/tk/lib/tkextlib/bwidget/listbox.rb | 12 ++++-- ext/tk/lib/tkextlib/bwidget/notebook.rb | 6 ++- ext/tk/lib/tkextlib/bwidget/spinbox.rb | 6 ++- ext/tk/lib/tkextlib/bwidget/tree.rb | 12 ++++-- ext/tk/lib/tkextlib/itk/incr_tk.rb | 6 ++- .../lib/tkextlib/iwidgets/scrolledcanvas.rb | 6 ++- ext/tk/lib/tkextlib/tile/style.rb | 2 +- ext/tk/lib/tkextlib/tkDND/tkdnd.rb | 6 ++- ext/tk/lib/tkextlib/treectrl/tktreectrl.rb | 6 ++- ext/tk/lib/tkextlib/winico/winico.rb | 6 ++- 24 files changed, 187 insertions(+), 100 deletions(-) diff --git a/ext/tk/ChangeLog.tkextlib b/ext/tk/ChangeLog.tkextlib index dfe4385955..83989c1a8e 100644 --- a/ext/tk/ChangeLog.tkextlib +++ b/ext/tk/ChangeLog.tkextlib @@ -1,3 +1,27 @@ +2004-12-16 Hidetoshi NAGAI + + * bwidget/labelentry.rb: use TkCore.callback_obj?() + + * bwidget/listbox.rb: ditto + + * bwidget/notebook.rb: ditto + + * bwidget/spinbox.rb: ditto + + * itk/incr_tk.rb: ditto + + * iwidgets/scrolledcanvas.rb: ditto + + * tkDND/tkdnd.rb: ditto + + * treectrl/tktreectrl.rb: ditto + + * winico/winico.rb: ditto + +2004-12-10 Hidetoshi NAGAI + + * tile/style.rb: 'theme_use' method bug fix + 2004-12-08 Hidetoshi NAGAI * bwidget/notebook.rb: raise method cannot return the raised page. diff --git a/ext/tk/lib/multi-tk.rb b/ext/tk/lib/multi-tk.rb index 38e4b28dec..49bb49da9d 100644 --- a/ext/tk/lib/multi-tk.rb +++ b/ext/tk/lib/multi-tk.rb @@ -1256,6 +1256,9 @@ end # for callback operation class MultiTkIp + def self.cb_entry_class + @@CB_ENTRY_CLASS + end def self.get_cb_entry(cmd) @@CB_ENTRY_CLASS.new(__getip, cmd).freeze end diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 3a8690305f..3cb911147a 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -574,6 +574,12 @@ end private :_toUTF8, :_fromUTF8 module_function :_toUTF8, :_fromUTF8 + def _callback_entry?(obj) + obj.kind_of?(Proc) || obj.kind_of?(Method) || obj.kind_of?(TkCallbackEntry) + end + private :_callback_entry? + module_function :_callback_entry? + =begin ### --> definition is moved to TkUtil module def _get_eval_string(str, enc_mode = nil) @@ -906,7 +912,8 @@ module TkComm # tagOrClass #end def bind(tagOrClass, context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -920,7 +927,8 @@ module TkComm # tagOrClass #end def bind_append(tagOrClass, context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -943,7 +951,8 @@ module TkComm # TkBindTag::ALL #end def bind_all(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -957,7 +966,8 @@ module TkComm # TkBindTag::ALL #end def bind_append_all(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -2107,7 +2117,8 @@ module TkBindCore # Tk.bind(self, context, cmd, *args) #end def bind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -2119,7 +2130,8 @@ module TkBindCore # Tk.bind_append(self, context, cmd, *args) #end def bind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tk/bindtag.rb b/ext/tk/lib/tk/bindtag.rb index adf96b9e3d..737223e3df 100644 --- a/ext/tk/lib/tk/bindtag.rb +++ b/ext/tk/lib/tk/bindtag.rb @@ -18,10 +18,11 @@ class TkBindTag def TkBindTag.new_by_name(name, *args, &b) return BTagID_TBL[name] if BTagID_TBL[name] - self.new(*args, &b).instance_eval{ + self.new.instance_eval{ BTagID_TBL.delete @id @id = name BTagID_TBL[@id] = self + bind(*args, &b) if args != [] } end diff --git a/ext/tk/lib/tk/canvas.rb b/ext/tk/lib/tk/canvas.rb index 3bc08e94fc..a0543cc42d 100644 --- a/ext/tk/lib/tk/canvas.rb +++ b/ext/tk/lib/tk/canvas.rb @@ -99,7 +99,8 @@ class TkCanvas 0 @@ -507,7 +507,7 @@ class TkText=',stop) txt = get(start,stop) @@ -1062,7 +1064,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index(start + " + #{pos} chars"), pat.split('').length] return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] @@ -1080,7 +1082,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index(start + " + #{pos} chars"), pat.split('').length] return [index(start + " + #{pos} chars"), _ktext_length(pat), pat.dup] @@ -1095,7 +1097,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index("1.0 + #{pos} chars"), pat.split('').length] return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup] @@ -1115,7 +1117,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index(stop + " + #{pos} chars"), pat.split('').length] return [index(stop + " + #{pos} chars"), _ktext_length(pat), pat.dup] else @@ -1139,7 +1141,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index("1.0 + #{pos} chars"), pat.split('').length] return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup] else @@ -1152,7 +1154,7 @@ class TkText 0 pos = _ktext_length(txt[0..(pos-1)]) if pos > 0 - if pat.kind_of? String + if pat.kind_of?(String) #return [index("1.0 + #{pos} chars"), pat.split('').length] return [index("1.0 + #{pos} chars"), _ktext_length(pat), pat.dup] else diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb index 37b83cc4aa..a80f4780c0 100644 --- a/ext/tk/lib/tk/texttag.rb +++ b/ext/tk/lib/tk/texttag.rb @@ -32,9 +32,9 @@ class TkTextTag 0 sleep = init_args.shift - if !sleep == 'idle' && !sleep.kind_of?(Integer) + if sleep != 'idle' && sleep != :idle && !sleep.kind_of?(Integer) fail ArguemntError, "expect Integer or 'idle' for 1st argument" end @init_sleep = sleep @@ -368,7 +376,8 @@ class TkTimer @current_sleep = @init_sleep @running = true if @init_proc - if not @init_proc.kind_of? Proc + # if not @init_proc.kind_of?(Proc) + if !TkComm._callback_entry?(@init_proc) fail ArgumentError, "Argument '#{@init_proc}' need to be Proc" end @current_proc = @init_proc @@ -421,7 +430,7 @@ class TkTimer sleep, cmd = @current_script fail RuntimeError, "no procedure to continue" unless cmd if wait - unless wait.kind_of? Integer + unless wait.kind_of?(Integer) fail ArguemntError, "expect Integer for 1st argument" end sleep = wait diff --git a/ext/tk/lib/tk/validation.rb b/ext/tk/lib/tk/validation.rb index 5a50de456d..eeb0163ee4 100644 --- a/ext/tk/lib/tk/validation.rb +++ b/ext/tk/lib/tk/validation.rb @@ -51,7 +51,8 @@ module Tk if keys[key].kind_of?(Array) cmd, *args = keys[key] keys[key] = klass.new(cmd, args.join(' ')) - elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method) + # elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method) + elsif TkComm._callback_entry?(keys[key]) keys[key] = klass.new(keys[key]) end } @@ -151,7 +152,8 @@ module Tk if keys[key].kind_of?(Array) cmd, *args = keys[key] keys[key] = klass.new(cmd, args.join(' ')) - elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method) + # elsif keys[key].kind_of?(Proc) || keys[key].kind_of?(Method) + elsif TkComm._callback_entry?(keys[key]) keys[key] = klass.new(keys[key]) end } diff --git a/ext/tk/lib/tkextlib/bwidget/labelentry.rb b/ext/tk/lib/tkextlib/bwidget/labelentry.rb index 1425ef7730..19e92d7ae4 100644 --- a/ext/tk/lib/tkextlib/bwidget/labelentry.rb +++ b/ext/tk/lib/tkextlib/bwidget/labelentry.rb @@ -28,7 +28,8 @@ class Tk::BWidget::LabelEntry # self #end def entrybind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -42,7 +43,8 @@ class Tk::BWidget::LabelEntry # self #end def entrybind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/bwidget/listbox.rb b/ext/tk/lib/tkextlib/bwidget/listbox.rb index 7f218c923c..178866f699 100644 --- a/ext/tk/lib/tkextlib/bwidget/listbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/listbox.rb @@ -49,7 +49,8 @@ class Tk::BWidget::ListBox # self #end def imagebind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -64,7 +65,8 @@ class Tk::BWidget::ListBox # self #end def imagebind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -88,7 +90,8 @@ class Tk::BWidget::ListBox # self #end def textbind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -103,7 +106,8 @@ class Tk::BWidget::ListBox # self #end def textbind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/bwidget/notebook.rb b/ext/tk/lib/tkextlib/bwidget/notebook.rb index 8888ab224b..01299d2de8 100644 --- a/ext/tk/lib/tkextlib/bwidget/notebook.rb +++ b/ext/tk/lib/tkextlib/bwidget/notebook.rb @@ -46,7 +46,8 @@ class Tk::BWidget::NoteBook # self #end def tabbind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -61,7 +62,8 @@ class Tk::BWidget::NoteBook # self #end def tabbind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/bwidget/spinbox.rb b/ext/tk/lib/tkextlib/bwidget/spinbox.rb index 66501ed702..52dfa30abc 100644 --- a/ext/tk/lib/tkextlib/bwidget/spinbox.rb +++ b/ext/tk/lib/tkextlib/bwidget/spinbox.rb @@ -27,7 +27,8 @@ class Tk::BWidget::SpinBox # self #end def entrybind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -41,7 +42,8 @@ class Tk::BWidget::SpinBox # self #end def entrybind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/bwidget/tree.rb b/ext/tk/lib/tkextlib/bwidget/tree.rb index 16ca8e8927..dadf3d5161 100644 --- a/ext/tk/lib/tkextlib/bwidget/tree.rb +++ b/ext/tk/lib/tkextlib/bwidget/tree.rb @@ -46,7 +46,8 @@ class Tk::BWidget::Tree # self #end def imagebind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -61,7 +62,8 @@ class Tk::BWidget::Tree # self #end def imagebind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -85,7 +87,8 @@ class Tk::BWidget::Tree # self #end def textbind(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -100,7 +103,8 @@ class Tk::BWidget::Tree # self #end def textbind_append(context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + #if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/itk/incr_tk.rb b/ext/tk/lib/tkextlib/itk/incr_tk.rb index 106ffa3519..1d80e1cd6b 100644 --- a/ext/tk/lib/tkextlib/itk/incr_tk.rb +++ b/ext/tk/lib/tkextlib/itk/incr_tk.rb @@ -350,7 +350,8 @@ module Tk fail RuntimeError, 'component is not assigned to a widget' end end - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -378,7 +379,8 @@ module Tk fail RuntimeError, 'component is not assigned to a widget' end end - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb index ba563ba589..939d97de67 100644 --- a/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb +++ b/ext/tk/lib/tkextlib/iwidgets/scrolledcanvas.rb @@ -102,7 +102,8 @@ class Tk::Iwidgets::Scrolledcanvas # self #end def itembind(tag, context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -116,7 +117,8 @@ class Tk::Iwidgets::Scrolledcanvas # self #end def itembind_append(tag, context, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/tile/style.rb b/ext/tk/lib/tkextlib/tile/style.rb index 3be8c1d580..c8c0a802df 100644 --- a/ext/tk/lib/tkextlib/tile/style.rb +++ b/ext/tk/lib/tkextlib/tile/style.rb @@ -67,6 +67,6 @@ class << Tk::Tile::Style end def theme_use(name) - tk_call('style', 'use', name) + tk_call('style', 'theme', 'use', name) end end diff --git a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb index d40d60217a..375ac89518 100644 --- a/ext/tk/lib/tkextlib/tkDND/tkdnd.rb +++ b/ext/tk/lib/tkextlib/tkDND/tkdnd.rb @@ -88,7 +88,8 @@ module Tk # self #end def dnd_bindtarget(type, event, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -127,7 +128,8 @@ module Tk # self #end def dnd_bindsource(type, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb index 11f723a8ff..9c1e977d14 100644 --- a/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb +++ b/ext/tk/lib/tkextlib/treectrl/tktreectrl.rb @@ -748,7 +748,8 @@ class Tk::TreeCtrl # self #end def notify_bind(obj, event, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new @@ -762,7 +763,8 @@ class Tk::TreeCtrl # self #end def notify_bind_append(obj, event, *args) - if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + # if args[0].kind_of?(Proc) || args[0].kind_of?(Method) + if TkComm._callback_entry?(args[0]) cmd = args.shift else cmd = Proc.new diff --git a/ext/tk/lib/tkextlib/winico/winico.rb b/ext/tk/lib/tkextlib/winico/winico.rb index 8a71cbb401..1e2f1c0062 100644 --- a/ext/tk/lib/tkextlib/winico/winico.rb +++ b/ext/tk/lib/tkextlib/winico/winico.rb @@ -149,7 +149,8 @@ class Tk::Winico if keys[k].kind_of?(Array) cmd, *args = keys[k] keys[k] = Winico_callback.new(cmd, args.join(' ')) - elsif keys[k].kind_of?(Proc) + # elsif keys[k].kind_of?(Proc) + elsif TkComm._callback_entry?(keys[k]) keys[k] = Winico_callback.new(keys[k]) end } @@ -164,7 +165,8 @@ class Tk::Winico if keys[k].kind_of?(Array) cmd, *args = keys[k] keys[k] = Winico_callback.new(cmd, args.join(' ')) - elsif keys[k].kind_of?(Proc) + # elsif keys[k].kind_of?(Proc) + elsif TkComm._callback_entry?(keys[k]) keys[k] = Winico_callback.new(keys[k]) end }