0

I have an NSMatrix with a bunch of NSButtonCells as its content. I want to create an effect similar to the Xcode4 navigator area (image from Apple website), where the selected button has a recessed feel to it with a shadow on the left and right sides.

I have seen similar styles with larger icons in the preferences panel of many third party applications, and I am wondering if there's an easy way to achieve this effect. Most likely, I don't know the right terminology for it.

I can of course draw these shadowed buttons myself and set it as alternate image of ButtonCell, I think the standard artwork that comes with apple is quite elegant and would like to use that instead.

Any help will be greatly appriciated

1 Answers1

0

In the case of large icons the effect is created by an NSToolbar. Unfortunately a toolbar is very limited (e.g. it's not a normal view; it can only appear in standard window frames, along the top, at full width). The "preferences panel" style is easy to create, but recreating that almost anywhere else requires you to do everything yourself.

Kevin Grant
  • 5,363
  • 1
  • 21
  • 24
  • Thanks Kevin. So what is the recommended approach for creating such effects. By that what I mean is, should I just create a background image and composite it at runtime with the foreground image, or is it more common to create two versions of all icons. – MachPortMassenger Jul 10 '12 at 16:50
  • I'm not aware of a standard way. Unfortunately the appearance changes between Mac OS X versions (e.g. on old systems a "selected" icon style was quite different from the recessed feel that's used now). I've inspected other application bundles before and it seems that many applications, including Apple's, contain artwork for all custom views in all states. – Kevin Grant Jul 11 '12 at 00:44