Re: NSFontPanel for a modal window

2015-06-15 Thread Kurt Sutter
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

Re: NSFontPanel for a modal window

2015-06-14 Thread Jack Brindle
I’’m surprised that no one else has suggested looking at the TextEdit source. It’s available from Apple as a sample… That should be rather revealing. - Jack On Jun 13, 2015, at 10:00 PM, Kurt Sutter k...@quansoft.com wrote: Good point. Yes, I have some changeFont: selectors in some of my

Re: NSFontPanel for a modal window

2015-06-14 Thread Uli Kusterer
On 14 Jun 2015, at 14:32, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 13 Jun 2015, at 21:30, 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

Re: NSFontPanel for a modal window

2015-06-14 Thread Graham Cox
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

Re: NSFontPanel for a modal window

2015-06-14 Thread Uli Kusterer
On 13 Jun 2015, at 21:30, 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. Coming late in here: Have you remembered to uncheck “visible on launch” in

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
Good point. Yes, I have some changeFont: selectors in some of my classes, but I don’t think any of them should be in the responder chain in that situation. Anyway, when I place stops in each of them, I see that none of them gets called until I make the font panel the key, whereupon the

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
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. Kurt On 14 Jun 2015, at 01:40, Graham Cox graham@bigpond.com wrote: On 13 Jun 2015, at 6:33 pm, Kurt Sutter k...@quansoft.com

Re: NSFontPanel for a modal window

2015-06-13 Thread Graham Cox
On 13 Jun 2015, at 6:33 pm, Kurt Sutter k...@quansoft.com wrote: Calling setWorksWhenModal:YES and/or setBecomesKeyOnlyIfNeeded:YES does not seem to resolve the issue either. I am at a loss here. What happens if you set those to YES first, then show it with -orderFront: (i.e.

Re: NSFontPanel for a modal window

2015-06-13 Thread Ken Thomases
On Jun 13, 2015, at 12:08 AM, Kurt Sutter k...@quansoft.com wrote: I have a modal window (run with [NSApp runModalForWindow:]) that sports a view that is a descendant of NSTextView. The view has key focus and text is selected therein. I then bring up the font panel calling [NSFontPanel

Re: NSFontPanel for a modal window

2015-06-13 Thread Kurt Sutter
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

Re: NSFontPanel for a modal window

2015-06-13 Thread Graham Cox
On 13 Jun 2015, at 3:08 pm, Kurt Sutter k...@quansoft.com 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

NSFontPanel for a modal window

2015-06-12 Thread Kurt Sutter
I have a modal window (run with [NSApp runModalForWindow:]) that sports a view that is a descendant of NSTextView. The view has key focus and text is selected therein. I then bring up the font panel calling [NSFontPanel sharedFontPanel] The font panel comes up, and does not have key focus. When