Merged revisions 65399 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65399 | martin.v.loewis | 2008-08-02 09:20:25 +0200 (Sa, 02 Aug 2008) | 3 lines

  Issue #799428: Fix Tkinter.Misc._nametowidget to unwrap
  Tcl command objects.
........
This commit is contained in:
Martin v. Löwis 2008-08-02 07:23:15 +00:00
parent 59b4b170ed
commit cdfae162c9
1 changed files with 9 additions and 9 deletions

View File

@ -1063,18 +1063,18 @@ class Misc:
def nametowidget(self, name): def nametowidget(self, name):
"""Return the Tkinter instance of a widget identified by """Return the Tkinter instance of a widget identified by
its Tcl name NAME.""" its Tcl name NAME."""
name = str(name).split('.')
w = self w = self
if name[0] == '.':
if not name[0]:
w = w._root() w = w._root()
name = name[1:] name = name[1:]
while name:
i = name.find('.') for n in name:
if i >= 0: if not n:
name, tail = name[:i], name[i+1:] break
else: w = w.children[n]
tail = ''
w = w.children[name]
name = tail
return w return w
_nametowidget = nametowidget _nametowidget = nametowidget
def _register(self, func, subst=None, needcleanup=1): def _register(self, func, subst=None, needcleanup=1):