• 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
Re: How do you get the font used in a menu item?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you get the font used in a menu item?


  • Subject: Re: How do you get the font used in a menu item?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 22 Apr 2009 10:53:20 +1000


On 22/04/2009, at 10:48 AM, Graham Cox wrote:


On 22/04/2009, at 10:36 AM, Jerry Krinock wrote:

I get a default menu from a newly-created popup button cell by sending

  -[NSPopUpButtonCell menu]

How can I find out the font used in this menu?  (It's an NSMenu.)

I don't see any 'font' accessors, and -[NSMenuItem attributedTitle] returns nil.


I can't see any way to do this - NSMenuItem's don't use cells, and there are no accessors. Menus use Carbon underneath, but all of the functions such as GetMenuItemFontID are unavailable for 64-bit.

You can either assume that [NSFont menuFontOfSize:] is reasonable, or set an attributed title and take that apart.


I suppose I should also have asked - why do you need to know?

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How do you get the font used in a menu item?
      • From: Jerry Krinock <email@hidden>
References: 
 >How do you get the font used in a menu item? (From: Jerry Krinock <email@hidden>)
 >Re: How do you get the font used in a menu item? (From: Graham Cox <email@hidden>)

  • Prev by Date: newbie questions on NSString* as a class attribute
  • Next by Date: Re: How do you get the font used in a menu item?
  • Previous by thread: Re: How do you get the font used in a menu item?
  • Next by thread: Re: How do you get the font used in a menu item?
  • Index(es):
    • Date
    • Thread