NSColorWell changing text color

295 Views Asked by At

I'm using NSColorWell in my app to change background color. However it changes text color in my NSTextView as well. I don't want it to change text color. How can I disable it? I just want to use it as a color picker form my background color.

1

There are 1 best solutions below

1
On

I believe what's happening is that when your NSTextView is the first responder it's accidentally collecting the color picker's changeColor(_:) action. The easiest thing to do that I can think of right now is to subclass NSTextView and override changeColor(_:) to do nothing at all.