How to change text color of menu items ?
10/07/03 22:41
Is it possible to change the style and color of menu items from Cocoa ?
Under OS X 10.3 (Panther), two new methods have been added to NSMenuItem interface to handle style of menu items:
- (NSAttributedString *)attributedTitle;
- (void)setAttributedTitle:(NSAttributedString *)string;
N.B.
The "set" method has to be called explicitly first, for the "get" one to return a non-null result. Calling setTitle or creating the menu item with NSMenu's addItemWithTitle doesn't create an attributed version of the title...
- (NSAttributedString *)attributedTitle;
- (void)setAttributedTitle:(NSAttributedString *)string;
N.B.
The "set" method has to be called explicitly first, for the "get" one to return a non-null result. Calling setTitle or creating the menu item with NSMenu's addItemWithTitle doesn't create an attributed version of the title...