Don't require leading '-' on option name to Text.tag_cget

This commit is contained in:
Guido van Rossum 1996-11-11 19:10:58 +00:00
parent c5d7e80739
commit 73eba25f5f
2 changed files with 8 additions and 0 deletions

View File

@ -1464,6 +1464,10 @@ class Text(Widget):
return self._bind((self._w, 'tag', 'bind', tagName),
sequence, func, add)
def tag_cget(self, tagName, option):
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'tag', 'cget', tagName, option)
def tag_config(self, tagName, cnf={}, **kw):
if type(cnf) == StringType:

View File

@ -1464,6 +1464,10 @@ class Text(Widget):
return self._bind((self._w, 'tag', 'bind', tagName),
sequence, func, add)
def tag_cget(self, tagName, option):
if option[:1] != '-':
option = '-' + option
if option[-1:] == '_':
option = option[:-1]
return self.tk.call(self._w, 'tag', 'cget', tagName, option)
def tag_config(self, tagName, cnf={}, **kw):
if type(cnf) == StringType: