summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk.rb
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-16 07:13:14 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-16 07:13:14 +0000
commit805bd6fb8cf8627101c048572334873dfefda0cd (patch)
treea70ebaa1952de781f07b1113f6b4cb8e1e9073be /ext/tk/lib/tk.rb
parent23565f4a489ddbe0b3939478c8fd842919185059 (diff)
* 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/branches/ruby_1_8@7574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk.rb')
-rw-r--r--ext/tk/lib/tk.rb24
1 files changed, 18 insertions, 6 deletions
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