How to color the text in the NSComboBox popup menu?
2 answers
You will need to change the menu items of the popup button right away, but it's not very difficult. You don't even need subclasses, you can do it all from a controller.
NSMenu *menu = [popUpButton menu];
NSMenuItem *item = [menu itemWithTag:100];
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor redColor], NSForegroundColorAttributeName, nil];
NSAttributedString *string = [[NSAttributedString alloc] initWithString:[item title] attributes:attributes];
[item setAttributedTitle:string];
You probably want to copy the attributes from the existing title attribute to keep the font and size the same, but that should get you started.
+1
a source to share