Modify NSMenu font
Modify NSMenu font
- Subject: Modify NSMenu font
- From: Massimiliano Origgi <email@hidden>
- Date: Fri, 21 Apr 2006 17:36:54 +0200
Hello,
I'm working on an NSStatusItem which uses a custom view, which, in
turn, when clicked shows a menu.
The font used in the menu is user customizable.
The simplest solution seems to be using NSMenu (void)
popUpContextMenu:(NSMenu *)menu withEvent:(NSEvent *)event forView:
(NSView *)view withFont:(NSFont *)font, but the popped up menu is
displayed using the rules of popup menus and not menubar menus for
its position and so it's not usable.
So, the current implementation uses NSStatusItem (void)
popUpStatusItemMenu:(NSMenu *)menu to show the menu and the font is
setup by iterating all contained menu items and setting a custom
attributed string for each of them.
This solution works fine, but I'd like to know if I have missed a
simpler approach to set a custom font for the whole menu without the
need to set all those attributed strings directly. Research so far
has brought nothing, except a vague reference to a private class
(which I don't want to use).
Thanks!
Massimiliano Origgi
http://www.intuiware.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden