Enabling / Disabling menus from a method in a module?

This might be a stupid question, and I know I can do it in the app’s EnableMenuItems event handler, but is it not possible to enable/disable a menu from a method in a module?

Example project:

https://www.dropbox.com/s/al96gk027qlkwuj/MenuItemTest.xojo_binary_project.zip?dl=raw

It is tricky because AFAIK you cannot enable/disable outside of the EnableMenuItems event.

You can pass the menubar to your method, but then you got to find a way to get to the enablemenuitems event.

@Markus Winter — I think so, as long as you set AutoEnable to false for that MenuItem.

@Markus Winter
What about setting a Boolean somewhere and check its value in App.EnableMenuItems ?

Also; For your dropbox link:
instead of RAW at the end of the link (who display a window and ask for an account), use 1, and the file will be directly downloaded.

https://www.dropbox.com/s/al96gk027qlkwuj/MenuItemTest.xojo_binary_project.zip?dl=1

:wink:

The answer to your question is no.

Michel is correct, you can only enable/disable items not set to AutoEnable during the EnableMenuItems event.
http://documentation.xojo.com/api/deprecated/menuitem.html#menuitem-enabled