Replace SetItemMark() with Cocoa code

Use of the (undocumented) NSMenuItemBullet was suggested by an Apple engineer and the consequences, if it is unavailable, are harmless.
This commit is contained in:
Allan Odgaard
2012-08-18 00:24:22 +02:00
parent cf1b4750e4
commit a2a0c187d4

View File

@@ -261,10 +261,10 @@ static void set_legacy_key_equivalent (MenuRef aMenu, UInt16 anIndex, std::strin
- (void)setModifiedState:(BOOL)flag
{
if(MenuRef menu = _NSGetCarbonMenu([self menu]))
if(NSImage* image = [NSImage imageNamed:@"NSMenuItemBullet"])
{
MenuItemIndex itemIndex = [[self menu] indexOfItem:self] + 1;
SetItemMark(menu, itemIndex, flag ? 0xA5 : noMark);
[self setMixedStateImage:image];
[self setState:NSMixedState];
}
}
@end