NSMenu bug
NSMenu bug
- Subject: NSMenu bug
- From: Steve Gehrman <email@hidden>
- Date: Mon, 10 Feb 2003 05:57:40 -0800
if I try to clear a menu item key equivalent like this....
[menuItem setKeyEquivalent:@""];
[menuItem setKeyEquivalentModifierMask:0];
The NSMenu that owns this menuItem does not sync correctly, it still
shows the old value.
The only way around this problem is to remove the menuItem and add it
back to the menu, this forces the menu to sync up with it's menu items
[menuItem retain];
{
NSMenu* menu = [menuItem menu];
int index = [menu indexOfItem:menuItem];
[menu removeItemAtIndex:index];
[menuItem setKeyEquivalent:[self key]];
[menuItem setKeyEquivalentModifierMask:[self modifiers]];
[menu insertItem:menuItem atIndex:index];
}
[menuItem release];
Anyone know a better way of solving this problem? Is this a known bug?
-steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.