In my experience, binding menu bar items just isn't worth it. Use - validateMenu… or -validateUserInterfaceItem: to conditionally enable the menu and give it a good title. Otherwise you've got to manually keep track of the main window etc. yourself which is a waste of your time.

On 21 May 2009, at 02:21, Jerry Krinock wrote:

On a main menu item, I've set a delegate which implements - menuNeedsUpdate:. In this method, I enable/disable some items and also modify some item titles based on current conditions.

With some items, however, instead of sending -setTitle: in - menuNeedsUpdate:, I had bound their 'title' in Interface Builder. But I just discovered that this 'title' binding was causing setEnabled:NO sent to these items during -menuNeedsUpdate: to be ignored. A menu item with a 'title' bound is always enabled.

The fix is obvious -- don't bind any titles, set all titles in menuNeedsUpdate:.

But ain't this a bug?  (Mac OS 10.5.6)

_______________________________________________

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/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net

_______________________________________________

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