Re: NSFontPanel again
Re: NSFontPanel again
- Subject: Re: NSFontPanel again
- From: Yann Bizeul <email@hidden>
- Date: Tue, 3 Dec 2002 11:53:55 +0100
Hi,
>
If you look really closely at the documentation, or better yet
>
NSFontPanel.h, you'll see that changeFont: is not a delegate method.
>
Some versions of the documentation are corrupted (I don't know if its
>
fixed yet) so it looks like changeFont: is in the delegate methods
>
section, but it really isn't, as the .h file will confirm.
Okay, I'm not familiar with Cocoa headers file, i'll consider them as a
better information source !
>
Its actually a method that is sent to the First Responder, and goes up
>
the Responder chain. Catching it in the window controller might work,
>
but you could have problems. For example, if you add an NSTextView to
>
your application's window and click in it to give it focus, you'll
>
suddenly find your code in the window controller is not called (because
>
the NSTextView consumes the event rather than passing it up the chain).
>
If this is an issue for you, check out NSFontPanel again. You'll see
>
you
>
can change the message sent when the font changes. eg, my app sends
>
something like myChangeFont: instead, which I catch where I want to
>
catch it (looks for docs on the Responder chain) and handle. When I'm
>
done handling it, I find the current first responder and send a
>
changeFont: message to it. That way I get my shot at the message
>
(myChangeFont:) but the regular changeFont: message is also available
>
to
>
anything that might be listening.
That explain my problem. But do not solve it, because I'll have to
instanciate a NSWindowController for a prefPane, and it doesn't seem to
work.
in my prefPane's - (id)initWithBundle:(NSBundle *)bundle I do this
after creating an subclass of NSWindowController and connected it to my
prefPane window in IB via the "window" outlet :
prefWindowController = [[ MyWindowController alloc ] initWithWindow: [[
self mainView ] window ]];
[[[ self mainView ] window ] setWindowController: prefWindowController
];
Without success, the MyWindowController is initialised, but do not
execute any of windowDidLoad, or myChangeFont: method.
Thanks for your answer !
--
Yann Bizeul
TYNSOE.ORG -
http://www.tynsoe.org/
Site technique consacri ` MacOS X
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.