Kaydet (Commit) 73eba25f authored tarafından Guido van Rossum's avatar Guido van Rossum

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

üst c5d7e807
...@@ -1464,6 +1464,10 @@ class Text(Widget): ...@@ -1464,6 +1464,10 @@ class Text(Widget):
return self._bind((self._w, 'tag', 'bind', tagName), return self._bind((self._w, 'tag', 'bind', tagName),
sequence, func, add) sequence, func, add)
def tag_cget(self, tagName, option): 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) return self.tk.call(self._w, 'tag', 'cget', tagName, option)
def tag_config(self, tagName, cnf={}, **kw): def tag_config(self, tagName, cnf={}, **kw):
if type(cnf) == StringType: if type(cnf) == StringType:
......
...@@ -1464,6 +1464,10 @@ class Text(Widget): ...@@ -1464,6 +1464,10 @@ class Text(Widget):
return self._bind((self._w, 'tag', 'bind', tagName), return self._bind((self._w, 'tag', 'bind', tagName),
sequence, func, add) sequence, func, add)
def tag_cget(self, tagName, option): 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) return self.tk.call(self._w, 'tag', 'cget', tagName, option)
def tag_config(self, tagName, cnf={}, **kw): def tag_config(self, tagName, cnf={}, **kw):
if type(cnf) == StringType: if type(cnf) == StringType:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment