Do you have a full program that demonstrates the problem? It's *likely* that str(w.entrycget(0, 'menu')) will return the menu's path as a string, in all cases.
It's also possible that import Tkinter Tkinter.wantobjects = 0 before creating any interpeter will get you a string instead. Tcl started as a typeless language: everything is a string, but some strings can be interpreted as lists, as numbers, or as commands. In later versions, Tcl gained an "object" representation, with a C type called TclObj* which could hold just a string, an efficient representation of numbers or lists, a pointer directly to a command, etc. With 'wantobjects = 1' (the default), a wrapper of a TclObject* can be returned from Tkinter calls, rather than a string. In this case, you're getting the command object that corresponds to the menu widget, rather than the string naming the menu widget, or the Python object that wraps that particular menu widget. Jeff
pgp7E4uiNxTig.pgp
Description: PGP signature
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss