Re: How do you get the font used in a menu item?
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:48:19 +1000
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.
--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