[Tkinter-discuss] Looking for example of how to use <<MenuSelect>> to determine currently selected menu item

python at bdurham.com python at bdurham.com
Sun Nov 21 18:56:43 CET 2010


Michael(s):

> def callback(event):
>    print event.widget.index('active')
>
> I see, this happens only with cascade menus, in my example I only had a
> popup menu, for which it worked as expected. Right now I am trying to
> figure out what's wrong with Tkinter (it's definitely a bug within
> Tkinter.py, and I doubt that it has been fixed since 2.6.5), I'll send
> another post when I know more. Of course for now you are right, your code
> "just works" :)

I can confirm that this bug still exists in 32-bit Python 2.7 for
Windows for both standalone and cascading menus.

Malcolm


More information about the Tkinter-discuss mailing list