Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdfae16

Browse files
committed
Merged revisions 65399 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent 59b4b17 commit cdfae16

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/tkinter/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,18 +1063,18 @@ def _options(self, cnf, kw = None):
10631063
def nametowidget(self, name):
10641064
"""Return the Tkinter instance of a widget identified by
10651065
its Tcl name NAME."""
1066+
name = str(name).split('.')
10661067
w = self
1067-
if name[0] == '.':
1068+
1069+
if not name[0]:
10681070
w = w._root()
10691071
name = name[1:]
1070-
while name:
1071-
i = name.find('.')
1072-
if i >= 0:
1073-
name, tail = name[:i], name[i+1:]
1074-
else:
1075-
tail = ''
1076-
w = w.children[name]
1077-
name = tail
1072+
1073+
for n in name:
1074+
if not n:
1075+
break
1076+
w = w.children[n]
1077+
10781078
return w
10791079
_nametowidget = nametowidget
10801080
def _register(self, func, subst=None, needcleanup=1):

0 commit comments

Comments
 (0)