The MenuBarSelected event handler - firing when it shouldn't

This event handler is intended so that one can enable/disable menu items based on the app state when a main menubar menu is selected. However, it seems that if I cause any contextual menu to want to appear (right-mouse over some spot where one will be created), this event handler will also fire. It makes no sense for this to happen, and I’ve not been able to discover any way to know, in this event handler, that a mainmenubar menu was actually selected.

Is this a bug or is there some context somewhere I can examine?

Remember that in API 1, this event was called EnableMenuItems. What you’re encountering is a place where Xojo renamed the event but didn’t consider all the places it fired. So no, not a bug because it fires when any menu is created or shown.

But no way to find out which menu, I suppose. If that’s a No, then I might file a feature request.

You do t need to know. Just set up any menus that you have based on the current state of your app.