diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-16 07:13:14 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-16 07:13:14 +0000 |
commit | c83543e0202901764591f750d7e69e5b204ec2d9 (patch) | |
tree | 5597a08bc2b54a058625fb6e088cb34a15d3bfa3 /ext/tk/lib/tk/texttag.rb | |
parent | 7b40b3fae2dd95d81d658bd2c043003f01de341b (diff) | |
download | ruby-c83543e0202901764591f750d7e69e5b204ec2d9.tar.gz ruby-c83543e0202901764591f750d7e69e5b204ec2d9.tar.xz ruby-c83543e0202901764591f750d7e69e5b204ec2d9.zip |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@7574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/lib/tk/texttag.rb')
-rw-r--r-- | ext/tk/lib/tk/texttag.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb index 37b83cc4a..a80f4780c 100644 --- a/ext/tk/lib/tk/texttag.rb +++ b/ext/tk/lib/tk/texttag.rb @@ -32,9 +32,9 @@ class TkTextTag<TkObject TTagID_TBL[@tpath][@id] = self Tk_TextTag_ID[1].succ! #tk_call @t.path, "tag", "configure", @id, *hash_kv(keys) - if args != [] then + if args != [] keys = args.pop - if keys.kind_of? Hash then + if keys.kind_of?(Hash) add(*args) if args != [] configure(keys) else @@ -139,7 +139,7 @@ class TkTextTag<TkObject @t.tag_configure @id, key, val end # def configure(key, val=None) -# if key.kind_of? Hash +# if key.kind_of?(Hash) # tk_call @t.path, 'tag', 'configure', @id, *hash_kv(key) # else # tk_call @t.path, 'tag', 'configure', @id, "-#{key}", val @@ -148,7 +148,7 @@ class TkTextTag<TkObject # def configure(key, value) # if value == FALSE # value = "0" -# elsif value.kind_of? Proc +# elsif value.kind_of?(Proc) # value = install_cmd(value) # end # tk_call @t.path, 'tag', 'configure', @id, "-#{key}", value @@ -167,7 +167,8 @@ class TkTextTag<TkObject # self #end def bind(seq, *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 @@ -181,7 +182,8 @@ class TkTextTag<TkObject # self #end def bind_append(seq, *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 @@ -222,9 +224,9 @@ class TkTextNamedTag<TkTextTag def self.new(parent, name, *args) if TTagID_TBL[parent.path] && TTagID_TBL[parent.path][name] tagobj = TTagID_TBL[parent.path][name] - if args != [] then + if args != [] keys = args.pop - if keys.kind_of? Hash then + if keys.kind_of?(Hash) tagobj.add(*args) if args != [] tagobj.configure(keys) else @@ -250,9 +252,9 @@ class TkTextNamedTag<TkTextTag #if mode # tk_call @t.path, "addtag", @id, *args #end - if args != [] then + if args != [] keys = args.pop - if keys.kind_of? Hash then + if keys.kind_of?(Hash) add(*args) if args != [] configure(keys) else |