summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/texttag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk/texttag.rb')
-rw-r--r--ext/tk/lib/tk/texttag.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb
index 78f7469869..37b83cc4aa 100644
--- a/ext/tk/lib/tk/texttag.rb
+++ b/ext/tk/lib/tk/texttag.rb
@@ -162,12 +162,30 @@ class TkTextTag<TkObject
@t.current_tag_configinfo @id, key
end
- def bind(seq, cmd=Proc.new, *args)
+ #def bind(seq, cmd=Proc.new, *args)
+ # _bind([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ # self
+ #end
+ def bind(seq, *args)
+ if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
_bind([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
self
end
- def bind_append(seq, cmd=Proc.new, *args)
+ #def bind_append(seq, cmd=Proc.new, *args)
+ # _bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
+ # self
+ #end
+ def bind_append(seq, *args)
+ if args[0].kind_of?(Proc) || args[0].kind_of?(Method)
+ cmd = args.shift
+ else
+ cmd = Proc.new
+ end
_bind_append([@t.path, 'tag', 'bind', @id], seq, cmd, *args)
self
end