summaryrefslogtreecommitdiff
path: root/lib/tktext.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-26 09:45:09 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-26 09:45:09 +0000
commit05da25f297c4d26b6bb454a9649b1dd63a102910 (patch)
tree568d1118ca9c2c7bfbcaf2d2132a7e870367d407 /lib/tktext.rb
parent839f4c5f3fdb4ea6b270fce17f1c3881060087d4 (diff)
980626
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tktext.rb')
-rw-r--r--lib/tktext.rb33
1 files changed, 12 insertions, 21 deletions
diff --git a/lib/tktext.rb b/lib/tktext.rb
index 8e6772c470..146944dde7 100644
--- a/lib/tktext.rb
+++ b/lib/tktext.rb
@@ -146,21 +146,12 @@ class TkTextTag<TkObject
end
def nextrange(first, last=nil)
- l = tk_split_list(tk_call(@t.path, 'tag', 'nextrange', @id, first, last))
- r = []
- while key=l.shift
- r.push [key, l.shift]
- end
- r
+ tk_split_list(tk_call(@t.path, 'tag', 'nextrange', @id, first, last))
end
def prevrange(first, last=nil)
+ tk_split_list(tk_call(@t.path, 'tag', 'prevrange', @id, first, last))
l = tk_split_list(tk_call(@t.path, 'tag', 'prevrange', @id, first, last))
- r = []
- while key=l.shift
- r.push [key, l.shift]
- end
- r
end
def [](key)
@@ -175,17 +166,17 @@ class TkTextTag<TkObject
tk_call @t.path, 'tag', 'cget', @id, "-#{key}"
end
- def configure(keys)
- tk_call @t.path, 'tag', 'configure', @id, *hash_kv(keys)
+ def configure(key, val=nil)
+ 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
+ end
+ end
+
+ def configinfo
+ tk_split_list(tk_call(@t.path, 'tag', 'configure', @id))
end
-# def configure(key, value)
-# if value == FALSE
-# value = "0"
-# elsif value.kind_of? Proc
-# value = install_cmd(value)
-# end
-# tk_call @t.path, 'tag', 'configure', @id, "-#{key}", value
-# end
def bind(seq, cmd=Proc.new, args=nil)
id = install_bind(cmd, args)