How is this Cocoa window architected? - xcode

I'm designing and building a Cocoa app (OX X, not a Cocoa Touch iOS app). I see other apps like Evernote, Chrome or Xcode have complicated, interesting top bars for their windows. How are these designed? Is it a custom window? If so, what is done to add the extra real estate?
A regular top bar looks like:
Evernote's top bar looks like

How are these designed?
They're almost certainly using NSToolbar, a Cocoa class that makes it easy to add a number of icons, buttons, search bars, etc. to the top of a window such that the items look like part of the window title bar. It's impossible to know what they're using just by looking at them, but NSToolbar is one way to get that effect.
Here's a good example straight from the linked documentation:

Related

How do I get controls to draw outside a window in Objective C

I've got a search-suggestion box that I've implemented by using an NSScrollView that appears when you start typing in an NSTextField. I'd like my window to be quite short, and have the ScrollView draw partially outside the window. Like this:
But instead I get this:
What can I do?
You can't have controls that extend outside of a window. What you need to do is put them in a separate window. You generally want that window to be a child of the original window (using -[NSWindow addChildWindow:ordered:]).
For the use case you describe, you should use the built-in control, NSComboBox. If you really want to reimplement this sort of control, Apple provides the CustomMenus sample code and a related WWDC video. It specifically includes a suggestions menu to help fill in a text field.

How do I get Mac Toolbar Items that look like the standard toolbar buttons?

I'm working on some updates to my first Mac app and I'm trying to get my window's toolbar buttons to look like the toolbar buttons on EVERY standard Mac app. However, for the life of me, I can't find a button type or a barbutton type that gets me what I'm looking for. Am I missing something?
Here is an image showing several Mac apps (Preview, Finder, and Safari) with toolbars at the top which have very-slighty rounded corner buttons which also have a slight gradient on them, etc.
However, in my .xib I've got a toolbar and I've dropped every kind of button I can find on the thing and nothing looks like the standard Mac button.
The first button looks pretty close, but it's clearly not the same color. Am I missing something?
#Matt Ball is right - you can use NSSegmentedControls, even for single one-time click buttons. Just set the number of segments to 1, and set the mode to "Select None".
One of my shipping apps uses this technique, see below:
All of the controls there are NSSegmentedControl, including the single one.
Update: there are a few standard button icons which are meant for toolbars. The NSImage Class Reference has a list.
In the above screenshot, only two of the buttons are using built-in images: NSLeftFacingTriangleTemplate, and NSRightFacingTriangleTemplate. The others I drew myself.

Cocoa Cover flow using NSBrowser

I have seen quote a few examples of implementing Finder with in the app.
http://developer.apple.com/mac/library/samplecode/SourceView/
I would like to know, using the existing NSBroswer can one be able to show the same contents in a coverflow? I mean to say the horizontal navigation with the items being displayed on the top?
Thanks.

Is there any thing like a NSBottomBar?

Okay of course i checked the API and there is nothing - at least under this class name.
What i mean is the widget referred to as a bottom bar in the Apple Human Interface Guidline.
Do i have to draw this myself from a NSView, if so how do i get the texture drawn?
alt text http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/AppleHIGuidelines/art/wn_newwindowparts.jpg
P.S.: I added Toolbar to the tags because it is the closest generic keyword i can find and the bottom bar ist just the opposite as a toolbar.
You're looking for the "content border." This is something you need to set in code with Leopard, but you can set it in Interface Builder in Snow Leopard (note you must be targeting 10.6 or above in order for this to be a valid setting in Interface Builder).
You can conveniently set a large or small border (using the standard Apple-approved sizes). To set this, select your window in Interface Builder, then show the Size inspector. At the bottom of the panel, you'll find the Content Border settings.
Brandin Walkin's excellent BWToolkit (BSD license) provides support for UI in the content border (among many other nice UI elements) and makes using a "bottom bar" much more enjoyable.

Cocoa : How to make a small toolbar like in Pages or Numbers?

Apples Application like Pages and Numbers always show an additional small Toolbar under the main Toolbar. Is there an object like this in the Interface Builder or do I have to build it from scratch?
I looked in the IB Library but found nothing so far.
You use NSSegmentedControl objects to do that, styled to Capsule. To achieve segmented controls with labels aligned underneath (which are clickable, like in Mail.app and Preview.app), you need to put them into toolbar button groups. That can't be done in IB. See this discussion in the Cocoa mailing list:
http://www.cocoabuilder.com/archive/cocoa/204390-capsule-style-toolbar-controls.html
There is no build-in control for that. You can take a look at the BWToolkit from Brandon Walkin. It has a lot of nice controls to build Apple-like applications. Maybe it can fit your needs...
It's just a simple view containing various controls. You could build most of it directly in Interface Builder. Just create an NSBox, give it a background color and then place "Mini"-sized controls in it.

Resources