# HG changeset patch # User Mark Lawrence # Date 1369067258 -3600 # Node ID b9826578d0d6ad4b6fe13d48507542e432be3d6f # Parent 6d2f0edb0758a24bb7c2018210f0384217cc3c72 Issue 734176 make tkinter nametowidget work with cloned menu widgets diff -r 6d2f0edb0758 -r b9826578d0d6 Lib/tkinter/__init__.py --- a/Lib/tkinter/__init__.py Mon May 20 10:33:27 2013 -0400 +++ b/Lib/tkinter/__init__.py Mon May 20 17:27:38 2013 +0100 @@ -1129,6 +1129,12 @@ """Return the Tkinter instance of a widget identified by its Tcl name NAME.""" name = str(name).split('.') + if '#' in name[-1]: + # This is a cloned menu, only the final widget in the split list + # is needed to retrieve it. Cloned menus have one or more '#'s + # where there would be '.'s instead, to indicate they are cloned + # menus. + name = (name[-1].split("#")[-1], ) w = self if not name[0]: