summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/texttag.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/texttag.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/texttag.rb')
-rw-r--r--ext/tk/lib/tk/texttag.rb22
1 files changed, 12 insertions, 10 deletions
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<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