Re: NSColorWell, changeColor: and first responder
Re: NSColorWell, changeColor: and first responder
- Subject: Re: NSColorWell, changeColor: and first responder
- From: Douglas Davidson <email@hidden>
- Date: Mon, 11 Aug 2003 12:12:39 -0700
On Monday, August 11, 2003, at 11:38 AM, Drew McCormack wrote:
I have a window with a NSColorWell and a NSTextView, which are
basically unrelated. I want to use the color well to set a color in my
model object. This works fine.
Problem is, if I click the well, I get a NSColorPanel, and if I leave
this open and then start editing the NSTextView, the text changes
color based on the selected color in the NSColorPanel.
It seems NSColorPanel sends a changeColor: message to the first
responder when a color is selected. This is not the behavior I want
though, in this case.
What is the best way to prevent this? Can I make the NSTextView not
display colors? Can I get the NSColorPanel not to send the message? Is
there an elegant solution short of an ugly subclass?
You can subclass NSTextView and arrange for it not to respond to
changeColor: when your color well is active. There are other
solutions, but this seems the most obvious.
Douglas Davidson
_______________________________________________
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.