Ingolf Jandt schrieb:
> I have written a simple NSPreferercePane (heir) for SystemPreferences.app to 
> set the Font defaults. The problem: The pane does not by default recieve the 
> font manager's changeFont: action message, and I have the strong feeling that 
> it should.
> 
> I have inserted [NSApp setDelegate: self] to get my class into the action 
> responder chain and to test the rest of my code. Everything works fine then, 
> but this is obviously not the right way.
> 
> Should the NSPreferencePane class be changed? Or must I send addNextResponder 
> to some object (which)? Or can I have missed some trivial step?
> 
> As I said the panel is finished except of this detail, and I will send in the 
> code for review (commit if appropriate) as soon as this issue is solved.
> 
> Ingolf
> 
> code snippet for illustration:
> 
> @implementation FontModule : NSPreferencePane
> ...
> - (void) setButtonAction: (id)sender
> {
>   NSFontManager *fontMgr=[NSFontManager sharedFontManager];
>   [fontMgr setSelectedFont: [previewTextField font]isMultiple:NO];
>   [fontMgr orderFrontFontPanel: self];
> }
> - (void) changeFont: (id) sender
> {
>   NSLog(@"changeFont: entered ..."); /*never reached without the [NSApp 
> setDelegate: self] hack*/
> ...

This font menu problem is something I noticed myself even with normal
applications like Ink. What happens is that the font menu takes focus
and then the changeFont: action is send down the first responder chain
to the font menu itself. No idea why this happens. It also depends on
the window manager in use. It did not happen to me on KDE until early
this year, when it change for unclear reasons.

I will need to investigate this in detail at some time.

Cheers
Fred


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to