Does anyone know how to set an NSMenuItem to show the diamond icon used to denote a minimised window? I've worked out how to use -setState: to set the "tick" (NSOnState) and the "dash" (NSMixedState), but that diamond seems curiously elusive...
Good idea, but that doesn't seem to work.
Does anyone know how to set an NSMenuItem to show the diamond icon used to denote a minimised window? I've worked out how to use -setState: to set the "tick" (NSOnState) and the "dash" (NSMixedState), but that diamond seems curiously elusive...
interface NSMenuItem (Hacks)
- (void)setOnStateImageHack:(NSImage *)image;
@end
@implementation NSMenuItem (Hacks)
- (void)setOnStateImageHack:(NSImage *)image
{
[_onStateImage release];
_onStateImage = [image retain];
}
@end
extern MenuRef _NSGetCarbonMenu(NSMenu *);
SetItemMark(_NSGetCarbonMenu([NSApp windowsMenu]), [[NSApp windowsMenu] indexOfItemWithTag:someTag] + 1, diamondMark);
extern MenuRef _NSGetCarbonMenu(NSMenu *);
MenuRef windowsMenuRef = _NSGetCarbonMenu([NSApp windowsMenu]);
if (windowsMenuRef != NULL)
SetItemMark(windowsMenuRef, [[NSApp windowsMenu] indexOfItemWithTag:someTag] + 1, diamondMark);