• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Modify NSMenu font
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Getting exact height of NSAttributedString
  • Next by Date: Re: Getting exact height of NSAttributedString
  • Previous by thread: Re: Getting exact height of NSAttributedString
  • Next by thread: Trying to read PICT data using Quartz functions
  • Index(es):
    • Date
    • Thread