From: Jonathan P. <jp...@dc...> - 2006-03-14 14:27:05
|
Here's the relevant bit from the documentation. Note that automatic =20 enabling is on by default. Enabling Menu Items By default, every time a user event occurs, NSMenu automatically =20 enables and disables each visible menu item. You can also force a =20 menu to update using NSMenu=92s update method. There are two ways to enable menus: =93Automatic Menu Enabling=94 NSMenu updates every menu item whenever a =20= user event occurs. A menu item is enabled if NSMenu can find an =20 appropriate object that responds to the menu item=92s action. If you =20 want a menu item to remain disabled even though an object responds to =20= the menu item=92s action, define a validateMenuItem: method for that =20 object. =93Manual Menu Enabling=94 You use setEnabled: to enable or disable = every =20 menu item individually. To choose a system, use NSMenu=92s setAutoenablesItems: with an =20 argument of YES (for automatic menu enabling) or NO (for manual menu =20 enabling). Automatic menu enabling is on by default. |