i've noticed that when adding attributes to a title (an NSMenuItem title in this case), if i don't specifically add an NSFontAttributeName to the attributes, the resulting attributed title will be much smaller and of different font than the other NSMenuItems.
in the code below, i would like "Stop Clock" to remain the default size and font of an NSMenuItem, while changing the remainder of the string. the closest i can get is the commented out line below, but it's still not the correct font or size. is this normal? if so, what is the default name and size of NSMenuItems?
perhaps it's possible to append the new attributed title to "Stop Clock" with something like the following? (something like meaning this code doesn't work).
in the code below, i would like "Stop Clock" to remain the default size and font of an NSMenuItem, while changing the remainder of the string. the closest i can get is the commented out line below, but it's still not the correct font or size. is this normal? if so, what is the default name and size of NSMenuItems?
Code:
NSMutableAttributedString *timeRemaining = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"Stop Clock - %d Remaining", [self timeMenuSelection]]];
[timeRemaining addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(10, ([appendedTimeRemaining length]-10))];
[COLOR="SeaGreen"]//[timeRemaining addAttribute:NSFontAttributeName value:[NSFont userFontOfSize:14] range:NSMakeRange(0, [appendedTimeRemaining length])];[/COLOR]
[MainMenu_Item3 setAttributedTitle:timeRemaining];
perhaps it's possible to append the new attributed title to "Stop Clock" with something like the following? (something like meaning this code doesn't work).
Code:
[MainMenu_Item3 setAttributedTitle:[NSString stringWithFormat:@"Stop Clock %@", timeRemaining]];