Re: NSFontPanel for a modal window
Re: NSFontPanel for a modal window
- Subject: Re: NSFontPanel for a modal window
- From: Kurt Sutter <email@hidden>
- Date: Sat, 13 Jun 2015 10:33:00 +0200
Thanks, Graham!
However, I don’t want the panel to get key focus by default. Just as in TextEdit, the font panel should come up, the focus should however remain with the text window. The user can then e.g. click another font in the font panel (which will update the font in the text window) and then just go on typing in the text window without first moving the key focus back into the text window.
Calling makeKeyAndOrderFront takes the key focus away from the text field.
Calling setWorksWhenModal:YES and/or setBecomesKeyOnlyIfNeeded:YES does not seem to resolve the issue either.
I am at a loss here.
Kurt
> On 13 Jun 2015, at 09:17, Graham Cox <email@hidden> wrote:
>
>
>> On 13 Jun 2015, at 3:08 pm, Kurt Sutter <email@hidden> wrote:
>>
>> I then bring up the font panel calling [NSFontPanel sharedFontPanel]
>>
>> The font panel comes up, and does not have key focus
>
>
> Just asking for the sharedFontPanel isn’t enough. You still need to show it using -makeKeyAndOrderFront:, and as an NSPanel subclass, you might also need to -setWorksWhenModal:YES and -setBecomesKeyOnlyIfNeeded:YES.
>
> By the way Apple, the Font Panel sucks. Please give it some love in 10.11
>
> —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