Re: How to disable application menu bar item
Re: How to disable application menu bar item
- Subject: Re: How to disable application menu bar item
- From: Graham Cox <email@hidden>
- Date: Thu, 21 May 2009 23:25:21 +1000
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 (email@hidden)
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:
This email sent to email@hidden