简体   繁体   中英

NSMatrix with Shadowed buttons on sides

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

In the case of large icons the effect is created by an NSToolbar . Unfortunately a toolbar is very limited (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM