Hi All

I have an NSTextView subclass, and when I make it first responder, it updates 
the color in the color panel, which causes the color panel to send a 
changeColor: message. Ditto when I change the selection.

In some cases, the color of my text is affected by things other than my 
textview, but when the user explicitly sets the color, I want to honor their 
wishes and turn off the automatic coloring. So when I get told that the color 
has changed, when in fact it's just synchronizing the color value with the text 
color, this causes a problem. I want to only receive color changed messages 
when the user actually changes the color. I can't just compare the old text 
color with the new color to know whether it has been changed by the user 
because the old color may have been automatically set.

I imagine I can override changeColor: in my subclass and do nothing when this 
message is received, and send the shared color panel a setTarget: and 
setAction: whenever my text field becomes first responder, and then reset them 
back to nil when it resigns first responder, but I would think that this would 
get past the initial issue when the text field becomes first responder, but I 
would still be receiving them whenever the selection changed - is this correct? 
Also I see that a NSColorPanelColorDidChangeNotification notification is sent, 
but again, it appears that it would be sent when the system is just 
synchronizing the color panel with the color of the text.

If none of these ways will help, how am I supposed to know when the user 
actually changes the color?


Thanks

Gideon

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to