On May 5, 2015, at 2:21 PM, David Durkee <da...@dwdurkee.com> wrote:

> Yes, this approach has worked much better. I see only two drawbacks.
> 
> 1) The first time the menu is opened, it takes as much as two seconds for it 
> to appear. This only seems to be true for the first instance of the menu that 
> is opened. (It’s a popup menu in a document window, so different documents 
> will each have their own instance of it.) Is there a way I can precache 
> whatever it is that takes so long that first time (the fonts I’m guessing)?
> 
> 2) The attributed title is also displayed in the NSPopupButton, where I would 
> rather see the font name displayed int he system font. (As in the font popup 
> in Pages.) Is there a way to force the button to not use the attributedTitle 
> of the selected NSMenuItem?

At a guess, subclass the NSPopuButtonCell and override its attributedTitle to 
return one with the system font. It’s probably just returning what it gets from 
the menuItem.

> 
> David
> 
>> On Apr 29, 2015, at 9:44 PM, Graham Cox <graham....@bigpond.com> wrote:
>> 
>> 
>>> On 30 Apr 2015, at 6:33 am, David Durkee <da...@dwdurkee.com> wrote:
>>> 
>>> using a custom view in each NSMenuItem to draw the name of the font in its 
>>> own font
>> 
>> 
>> This isn’t really necessary - you can just set an attributed title on a 
>> standard menu item and it will draw in the Font given in the attributes. You 
>> might find that is easier and less buggy than adding a view to the item.
>> 
>> —Graham
>> 
>> 
> 
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/lrucker%40vmware.com
> 
> This email sent to lruc...@vmware.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to