On 21/05/2009, at 10:36 PM, Ashish Tiwari wrote:

I want to conditionally disable some items of my application menu bar for example "Format", "Insert" etc, so that user can not click on it and can not see its submenu.
When i do following:
[[[NSApp mainMenu] itemWithTitle:@"Insert"] setEnabled:NO];

Menu item "Insert" in menu bar still appears enabled but all items in its submenu get disabled. Basically my purpose is solved as user can not select any of sub menu items but i want "Insert" itself to be disabled so that user can not even see its submenu.
Is it possible in Mac (Windows it can be done)?
If yes,  then How can i do so.


I believe the modern approach is not to do this. Menus are meant to act as a "road map" to the application and should be browsable and stable, with greying to indicate inappropriate choices.

The earlier Mac OS did allow title disabling, but one problem with it is being context sensitive, yet always visible, it wasn't always easy or efficient to update the title state in a timely fashion when the context changed (selections, etc). It seems OS X has deprecated this ability and nobody has missed it. You want your app to fit in, not stand out for the wrong reasons.

Don't forget that Windows copied the earlier Mac OS too...

--Graham
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to