简体   繁体   中英

Python/Tkinter: bind to event related to currently selected menu item

Wondering if there's a menu event I can bind to that's related to the currently selected menu item? By menu item I mean the items that show up in a popup menu like New, Open, Save, etc.

Use case: I would like to update a statusbar area of our application with a description of the currently selected menu item.

Any ideas appreciated.

Thank you, Malcolm

您需要绑定到<<MenuSelect>>事件。

There's an <Enter> event that is triggered when the mouse pointer enters a widget's space. Depending on how you're building your menu, you may be able to use it.

See http://www.pythonware.com/library/tkinter/introduction/events-and-bindings.htm for more

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM