summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tk/texttag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tk/texttag.rb')
-rw-r--r--ext/tk/lib/tk/texttag.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/tk/lib/tk/texttag.rb b/ext/tk/lib/tk/texttag.rb
index 561a027f08..17909bbfcf 100644
--- a/ext/tk/lib/tk/texttag.rb
+++ b/ext/tk/lib/tk/texttag.rb
@@ -49,6 +49,14 @@ class TkTextTag<TkObject
@id
end
+ def exist?
+ if ( tk_split_simplelist(_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'names'))).find{|id| id == @id } )
+ true
+ else
+ false
+ end
+ end
+
def first
@id + '.first'
end
@@ -100,6 +108,10 @@ class TkTextTag<TkObject
end
def cget(key)
+ @t.tag_cget @id, key
+ end
+=begin
+ def cget(key)
case key.to_s
when 'text', 'label', 'show', 'data', 'file'
_fromUTF8(tk_call_without_enc(@t.path, 'tag', 'cget', @id, "-#{key}"))
@@ -121,6 +133,7 @@ class TkTextTag<TkObject
@id, "-#{key}")))
end
end
+=end
def configure(key, val=None)
@t.tag_configure @id, key, val