Reputation: 22633
I've seen this toolbar-like UI element in a couple of apps, and I'd like to know if there's a standard Cocoa object for such an element.
If a standard Cocoa implementation does not exist, can anyone suggest a good open-source library?
Upvotes: 4
Views: 721
Reputation: 46020
In the second example, the buttons are what Interface Builder calls "Gradient Buttons" which have that appearance without needing a background image. The buttons are just butted up next to one another.
In the other examples, the "toolbar" is just an ordinary NSView
with a custom image background, with standard NSButton
objects as subviews. The buttons have their border disabled so all you see is the icon.
To get the "inset" look for the icons, the button images are most likely template images. To make an image a template image, it must consist of black and clear colors only, with an alpha channel. You then call [image setTemplate:YES]
on the NSImage
object.
Apple supplies some pre-canned template images which you can access by using the +imageNamed:
method of NSImage
.
Upvotes: 2
Reputation: 9392
Not sure if this is what you want, but have you tried Matt Gemmell's MGScopeBar?
Upvotes: 0
Reputation: 385500
In the case of Xcode, it's a private class called IDENavigatorFilterControlBar
, with this inheritance hierarchy:
IDENavigatorFilterControlBar
IDEFilterControlBar
DVTBorderedView
DVTAutoLayoutView
NSView
DVT is the prefix used by the private Developer Tools framework.
Upvotes: 1