Color Status Bar in Cocoa with NSIndicator

Posted by dacc on February 27, 2009

I wanted to make an status indicator bar in Cocoa that I could switch between green, yellow, and red. Here’s how to do it with the NSIndicator control.

First add the control in Interface Builder and configure it as so:

nsindicator

Now you can use a call like the one below to change its color:

[statusIndicator setIntValue: 1]

Here is each value you can use and the corresponding status bar:

0
1
2
3
Trackbacks

Use this link to trackback from your own site.

blog comments powered by Disqus