summaryrefslogtreecommitdiff
path: root/lib/tktext.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-11 10:03:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-11 10:03:21 +0000
commit1bc6f594d3de8dbfb5c165835eaec99bd49327c8 (patch)
treed535a84c63a5cf779aa1ae83f89ed64f22040471 /lib/tktext.rb
parent3f5b1ec9cb657375a0c467ac70fdd6fbdc97f018 (diff)
1.1b9_25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tktext.rb')
-rw-r--r--lib/tktext.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/tktext.rb b/lib/tktext.rb
index ccd70a20a7..a940c31a1b 100644
--- a/lib/tktext.rb
+++ b/lib/tktext.rb
@@ -27,8 +27,8 @@ class TkText<TkTextWin
def _addtag(name, obj)
@tags[name] = obj
end
- def tag_names
- tk_send('tag', 'names').collect{|elt|
+ def tag_names(index=nil)
+ tk_split_list(tk_send('tag', 'names', index)).collect{|elt|
if not @tags[elt]
elt
else
@@ -103,13 +103,17 @@ class TkTextTag<TkObject
tk_call @t.path, 'tag', 'add', @id, *index
end
+ def remove(*index)
+ tk_call @t.path, 'tag', 'remove', @id, *index
+ end
+
def configure(keys)
tk_call @t.path, 'tag', 'configure', @id, *hash_kv(keys)
end
- def bind(seq, cmd=Proc.new)
- id = install_cmd(cmd)
- tk_call @t, 'tag', 'bind', tag, "<#{seq}>", id
+ def bind(seq, cmd=Proc.new, args=nil)
+ id = install_bind(cmd, args)
+ tk_call @t, 'tag', 'bind', @id, "<#{seq}>", id
@t._addcmd cmd
end