Discussion:
[Python-3000-checkins] r65401 - in python/branches/py3k: Lib/tkinter/__init__.py
martin.v.loewis
2008-08-02 07:23:15 UTC
Permalink
Author: martin.v.loewis
Date: Sat Aug 2 09:23:15 2008
New Revision: 65401

Log:
Merged revisions 65399 via svnmerge from
svn+ssh://pythondev at 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.
........


Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/tkinter/__init__.py

Modified: python/branches/py3k/Lib/tkinter/__init__.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/__init__.py (original)
+++ python/branches/py3k/Lib/tkinter/__init__.py Sat Aug 2 09:23:15 2008
@@ -1063,18 +1063,18 @@
def nametowidget(self, name):
"""Return the Tkinter instance of a widget identified by
its Tcl name NAME."""
+ name = str(name).split('.')
w = self
- if name[0] == '.':
+
+ if not name[0]:
w = w._root()
name = name[1:]
- while name:
- i = name.find('.')
- if i >= 0:
- name, tail = name[:i], name[i+1:]
- else:
- tail = ''
- w = w.children[name]
- name = tail
+
+ for n in name:
+ if not n:
+ break
+ w = w.children[n]
+
return w
_nametowidget = nametowidget
def _register(self, func, subst=None, needcleanup=1):

Loading...