NSProgressIndicator color change?

What is the best way to change the color of the NSProgressIndicator, is there an easier way than just subclassing it and then drawing the whole component yourself?

Basically what I want to do is have a similar component, but with the ability to change the panel color.

I tried googling it, but all the questions were pretty outdated and didn't really relate to the 10.10 version of OS X I'm working on. Also checked the cocoa controls and only found one component which was for an outdated version of OS X.

+3


source to share


2 answers


You can use quartz filters (such as tint adjustment) to do this directly in the Interface Builder. This works better than expected.

NSProgressIndicator



It's in the Effects Inspector. In the "Content Filters" section, you can add "Tint"

enter image description here

+9


source


To change the color NSProgressIndicator

, use the setControlTint: method . If you want to set your own color, you must manually draw such a control. However, you must use the system color to maintain this control on the system.



0


source







All Articles