5

I've been looking around and I can't find much information on how I would go about creating a window similar to the Mac App Store or iTunes. It has a thicker title bar with buttons ect. as you can see in the image below.

Any help would be much appreciated.

http://youfindr.webs.com/Screen%20Shot%202012-03-20%20at%2017.28.39.png

N West
  • 6,768
  • 25
  • 40
BenJacob
  • 957
  • 10
  • 31
  • take a look at [this](http://stackoverflow.com/questions/6982761/how-do-i-increase-the-height-of-the-title-bar-in-a-cocoa-application). – Parag Bafna Mar 20 '12 at 18:19
  • possible duplicate of [NSWindow Mac App Store like Title Bar](http://stackoverflow.com/questions/4586721/nswindow-mac-app-store-like-title-bar) – jscs Mar 20 '12 at 18:38
  • @IuliusCæsar I did have a look at that one but i was wondering if there was a simpler way of doing it. – BenJacob Mar 20 '12 at 18:49
  • Simpler than using a class that someone else has already written for you? – jscs Mar 20 '12 at 18:52
  • @IuliusCæsar Yes, its a fairly long class and though this may be a good way of doing it. I want to know if there is a shorter, simpler way. – BenJacob Mar 20 '12 at 18:55

2 Answers2

3

In Interface Builder there's an item called "Toolbar". Drag that onto your Window, then you can add "Image Toolbar Items", "Flexible Space Toolbar Item", etc.

afrederick
  • 1,388
  • 1
  • 10
  • 24
  • Is there a way of using the Toolbar with custom views ect? – BenJacob Mar 20 '12 at 18:50
  • The Toolbar wants you to add items of the NSToolbarItem class which I'm sure you can subclass. Drag out a Toolbar then double click on it, that will allow you to add and remove the toolbar items. You can drag out an "Image Toolbar Item" in which you can set your own custom image icon. – afrederick Mar 20 '12 at 18:57
  • I didn't want to use a toolbar as i thought it might be too constraining but I've had a look at it and i may use that - thanks. – BenJacob Mar 20 '12 at 19:05
  • You're welcome. It looks like you're new to Stack Overflow, welcome! You should create an account with a permanent username. If you're satisfied with my answer please select it as "Accepted". Thanks! – afrederick Mar 20 '12 at 19:33
2

There are some similar questions to this one: Title Bar Buttons and Custom Title Bars.

I think the main workaround is to create your own view to be placed in top of the titlebar as a child of your window's content superview.

Community
  • 1
  • 1
Nickkk
  • 2,261
  • 1
  • 25
  • 34
  • So would i have to create my own custom title bar from scratch? – BenJacob Mar 20 '12 at 18:04
  • Basically, yes. You can follow the link in the page I posted to get a good example on how to do this. Adding a toolbar could be an option, but if you want to achieve the same look as in the image (i.e. the buttons partially over the titlebar) you'll have to add a custom view. – Nickkk Mar 21 '12 at 16:11