views:

192

answers:

3

Is there any way to have 2 toolbars in one NSWindow. Something like Pages. With one large on at the top, and a smaller one below that.

+4  A: 

NSWindow only supports one NSToolbar.

If you want to have a "second level" like Pages, you'll need to create your own non-NSToolbar-based solution.

Note that in Pages, the smaller "toolbar" isn't really a toolbar (as in NSToolbar), and is not editable. You should be able to recreate this with a simple custom view to draw the top and bottom lines, but let the window background through. Just position the view and set its autosizing as appropriate, then add your controls to the view.

Update: I believe NSBox can be configured to draw specific edges as of Leopard or Snow Leopard. Just a thought.

Joshua Nozzi
I couldn't find it in NSBox, but there was BWGradientBox, and there I could set the individual colors. Your answer was the closest though, so you solved it for me ;-)
Tristan Seifert
A: 

See the SO entry which is related.

Laurent Etiemble
+3  A: 

A good open source control you might find useful as an example of how to implement something like this is MGScopeBar.

Marc Charbonneau