This sample shows how to enable/disable menu items dynamically
It implements
- a 'global' command (command1:) that is avalaible/unavalaible depending on thje setting of a UI element.
- a 'first responder' command (command2:) that is avalaible only when a certain view is selected
- a standard command (copy:) in a trivial way.
What is important to understand is that the objects are not aware of which MenuItems will send them commands. This offer a lot of flexibility. The information flow is not from objects to MenuItems, but in the opposite way.
More information is contained in the headers.
about 8 kb