Re: Passing FirstResponder calls to next responder
Re: Passing FirstResponder calls to next responder
- Subject: Re: Passing FirstResponder calls to next responder
- From: Kevin Smith <email@hidden>
- Date: Sat, 9 Aug 2003 13:59:56 -0400
On Saturday, August 9, 2003, at 10:05 AM, publiclook wrote:
On Friday, August 8, 2003, at 09:55 PM, Kevin Smith wrote:
I have a document-based application that uses combo boxes to modify
font families as well as the normal font panel. The interface also
uses the font menu and buttons on the interface for bold, italic,
etc. When a bold or italic button is pressed, I want the combo box
to pass the message to the next responder. If a font name is
selected in the font panel, the combo box should select the new font
name and also pass the message to the next responder. I realize that
I'm probably going to have to create a subclass of NSComboBox to do
this, but how to I pass the FirstResponder messages on to the next
responder?
Don't subclass NSComboBox for this.
Read about the responder chain. There is no problem sending messages
to -nextResponder or even using -tryToPerform:with:.
I've been reading everything I can find, but I still don't see how to
get this to work. When I edit something in the NSComboBox it becomes
the first responder, and absorbs the changeFont: messages. I don't
want it to do this. The only FirstResponder messages I want it to
respond to are copy:, cut:, and paste:. Every other message should
just be sent on. I don't see any way to get it to stop intercepting
these messages except maybe through subclassing.
See the following for information about combining font attributes
arbitrarily from multiple sources:
- (void)changeFont:(id)sender
This action method changes the font of the selection for a rich text
object, or of all text for a plain text object. If the receiver
doesnt use the Font panel, this method does nothing.
This method changes the font by sending a convertFont: message to the
shared NSFontManager and applying each NSFont returned to the
appropriate text. See the NSFontManager class specification for more
information on font conversion.
See Also: usesFontPanel
This would be great if the NSComboBox actually supported this method,
but it's only valid on NSText objects.
Kevin Smith
email@hidden
_______________________________________________
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.