summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/canvastag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk/canvastag.rb')
-rw-r--r--ext/tk/lib/tk/canvastag.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/tk/lib/tk/canvastag.rb b/ext/tk/lib/tk/canvastag.rb
index 3d5c6703d2..5d1d5e92ab 100644
--- a/ext/tk/lib/tk/canvastag.rb
+++ b/ext/tk/lib/tk/canvastag.rb
@@ -21,12 +21,30 @@ module TkcTagAccess
@c.bbox(@id)
end
- def bind(seq, cmd=Proc.new, *args)
+ #def bind(seq, cmd=Proc.new, *args)
+ # @c.itembind(@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
@c.itembind(@id, seq, cmd, *args)
self
end
- def bind_append(seq, cmd=Proc.new, *args)
+ #def bind_append(seq, cmd=Proc.new, *args)
+ # @c.itembind_append(@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
@c.itembind_append(@id, seq, cmd, *args)
self
end