Yes, you are right. The actual showing of the font panel occurs by calling

        NSFontManager*  shrdFontMgr = [NSFontManager sharedFontManager];
        [shrdFontMgr orderFrontFontPanel:textView];

This shows the font panel, but does not make it active. When I click into a new 
font of that font panel the changeFont: message of my text view is not called.

However, if I subsequently call

        NSFontPanel*    fontPanel = [NSFontPanel sharedFontPanel];
        [fontPanel makeKeyWindow];

The font panel becomes key window, and clicking a new font then invokes the 
changeFont: message.

As to Jack Brindle’s comment (thanks for that):
> As the docs say for runModalForWindow: the app is only getting events for 
> that window. Everything see is ignored. Presumably this is the heart of the 
> problem, although I wonder how the font window is being displayed if it 
> cannot get events itself, assuming it is actually running inside your app.
> 
> Take a look at the runModalSession: type of handling modal windows. This 
> allows other things to happen while your modal window is up. This might be 
> what you need to get the fontWindow to respond properly. I know we do 
> something similar for modal windows, but don’t remember just what that is at 
> present. I’ll try to remember to look tomorrow, but I hope you have the 
> solution before then.
> 
I have also tried runModalSesssion before, but just using a runModalSesssion 
loop instead of a call to runModalForWindow: does not change anything, the 
issue remains, and I have not found any way to make the font panel more 
responsive in that loop.


I am getting the impression that NSFontPanel has some basic issues when being 
run with a modal window.

Best

Kurt

 


> On 14 Jun 2015, at 23:52, Graham Cox <graham....@bigpond.com> wrote:
> 
> 
>> On 14 Jun 2015, at 2:30 pm, Kurt Sutter <k...@quansoft.com> wrote:
>> 
>> It does not help — the panel i actually already in front when it appears, 
>> and calling -orderFront: does not help. It only works when it is the key 
>> window.
> 
> 
> OK, it’s time to show your code.
> 
> What’s odd is that you say your font panel is visible (or becomes visible) 
> when you invoke [NSFontPanel sharedFontPanel]. If that’s what you’re saying, 
> then it’s incorrect - just obtaining the shared font panel doesn’t normally 
> make it visible or frontmost. So something else is going on.
> 
> —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/archive%40mail-archive.com

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

Reply via email to