Problems with main menubar

Hi all,

I have two problems with the main menubar.
I cannot reproduce them consistently (yet), they happen seemingly randomly.
I am trying to make a reproducible example but until that happens, maybe someone can shed some insight on this behaviour.

========================================================================================

  1. Menu items do not get enabled programatically in all cases
    ========================================================================================
  • In my app, the user can select and edit different parts of the window (4 parts named CS, CA, AS, AV).
  • Editing can also happen through menu items, and through shortcuts
  • Each part has a different menu item (actually two, but for the example lets say that there is only one), but each item has the same shortcut (thus 4 items, and the shortcut is cmd-i).
    • Only one item is enabled at any time
    • This is controlled programatically when the user clicks on a particular part of the window
    • It is done by calling method, which first disables all menu items, and then enables the one that correspond to the part that is clicked

The problem is that sometimes enabling the menu item does not enable its shortcut.
For example, if a user clicks CS part, the EnableMenuItems is called, and the MenuItem is enabled (as seen through the debugger), but the cmd-i does not work.
However, if a user then clicks the main menubar, the appropriate item is enabled, and that particular shortcut starts working again.

========================================================================================
2. Menu items get disabled for no particular reason

  • This may be internal bug, but again, maybe someone has experienced something similar so I will put it here
  • In my app, the user can load, check, and save the data.
  • The loading of the data enables the save and check menu items in most cases
  • However, in seemingly random occasions, the save and check menu items do not get enabled on load