Thick title bar window in cocoa, similar to iTunes - objective-c

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.

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.

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.

Related

iOS 7, status bar and navigation bar: hiding or sliding with side panels as Reeder does

I suppose this is an old one. I have a sliding panel (JASidePanel) with a menu and I want to hide or slide the status bar while showing the menu. So, I have two options:
Hide the status bar and keep the height of my navigation bar.
Or slide the status bar with the panel.
I see these two options are possible. The first one via swizzling of the sizeToFit of the UINavigationBar (link). The second one via a snapshot of the screen before animating the panel.
But I see Reeder, that takes the second option and brings it to another level: the panel is not really a screenshot, is the actual view of the panel so the status bar is slide but continues being updated, also the panel does!
So, I have a couple of questions: how is the Reeder solution possible? And the second one, is it secure to perform method swizzling? Could it be rejected by Apple?
Thank you.
Finally I implemented the first solution as shown in this link.

how to align text center in nsMenuItem Cocoa Mac osx

I am new in MAC OS X development, I have to align text centre in nsMenuItem but I not find any particular solution. I checked on google but not find any tutorial.
Find some tutorial but not exactly same, in these tutorial we take a NSView in nsMenuItem and then Insert subview in NSVIEW to accomplish it centre align.
Is there is any better solution? Please provide me link if possible.
Edit : I attached screen shot, but this is not working for me.
Thanks
You can set the Attributed String of the menu item, which does allow you to center the text, as well as change the font, color and size of the text as well.
I do not know which version of Xcode/OSX you are using, but under Xcode 5.0.2 you can use the built-in interface builder to edit the attributed strings of menu items.
Click the MainMenu.xib entry, then click the menu you want to edit to open it, then click the menu entry. On the right side of the window there should be some options, if not click the right most square in the group of 3 at the top right of the Xcode window 1.
Once you have the right panel open click the Attributes Inspector icon [2] (4th from the left, looks like a slider type icon). At the bottom of the list of attributes you will see an entry for "Attrib. Title" [3].
That is where you can set a custom font, color and alignment for your menu item.
If you need more control then that provides, you can also embed custom NSViews into your menus which gives you complete control over how the menu will look.

INAppStoreWindow Toolbar

I was wondering how I could add a toolbar in the titlebar using INAppStoreWindow. I succesfully added InAppStoreWindow in my application but I was thinking how to add a toolbar like the 'AppStore.app' in the center of my titlebar using INAppStoreWindow.
Nowhere on the internet nor stackoverflow has a similer topic about this toolbar inside this INAppStoreWindow method. I hope somebody could tell me if this is possible and how as I can't find any examples.
If you create an NSView with the contents of what you want to be on your window's titlebar, and have IBOutlets to both your window and that view, it can be done in 2 lines of code.
(In this case, the view is titleView and the window is theWindow)
//Make the titlebar view the same size
[self.titleView setFrameSize:self.theWindow.titleBarView.frame.size];
//Add the view to the window's "titleBarView"
[self.theWindow.titleBarView addSubview:self.titleView];

How to make a tab bar that shows colored icons , on iOS?

I need to make a toolbar on the bottom of the screen with some buttons. I want in every button to have a small image and a small text under it. The closest i can find from "Xcode" is the "Tab Bar" where you can put icons and text but the problem is that when you add an image you can only see the shadow of the image and not its colors.. Can i change that? Or is another way to make a toolbar like the one i am describing?
EDIT
I need the buttons to change controllers and i just noticed that i cant create actions for the tabs but only outlets. So i guess the tab bar is not what i should use. Any ideas for a toolbar?
Yes Tab Bar is the Best approach for it and it is very easy to customize the tab bar if u are using IO5
This LINK will be helpful.
There is another approach (which was applicable uptil IOS4 for customization of Tab bar) was to Create Custom buttons with tab bar look alike Images. it will give u the same feel, but like i said it is very easy now to customize IOS Tab bars
Here is a couple of Links for u
LINK 1 With Story BOARD
LINK 2 Without Storyboard
One More thing Try searching Google before Posting a question here if have some problem then feel free to post along with the code or tutorial u tried.
Let me know if i Worked
Cheers
W

How do you vertically centering an image on an NSButton

I'm build a Mac application in the style of the Lion Mail.app. As part of this I'm attempting to create a simular toolbar to the one in the Mail.app but I can't seem to get the image in my toolbar button centered vertically.
Looking at the Mail.app toolbar I see a nice series of buttons with centered icons:
but when I go interface builder I can't seem to recreate the same button. What I get is:
What I've tried doing is, in Interface Builder:
Create a new window
Add a NSToolbar to that window
Add an NSButton to the toolbar with Style - 'Push', Image - 'Envelope', Position - 'NSImageOnly', Scaling - 'Proportionally Down'
As you can see the icon is clearly not centered vertically on the button like those in the Mail.app toolbar.
Anybody have any ideas???
At the moment I'm using XCode 4.2 and laying out this button with Interface Builder. I'm trying to build the toolbar button by ONLY adding the image to the button and not painting the button for each item, ie drawing the border and icon.
Any help would be greatly appreciated as this has been driving me a little nuts.
Thanks in advance - AYAL
Turns out the answer to this problem was much simpler then I had expected. After a lot of teeth gnashing, hair pulling, and twiddling pixels I came across the solution.
Instead of using a 'Push' button I simply had to switch to a 'Round Textured' button. Once I did that any image I added to the button was nicely centered. Next I just had to manually scale my image to look right.
The recipe then for a Mail.app Toolbar is as follows:
Add a button to your Toolbar
Set the button style to 'Rounded Textured'
Set the image of the button
Set the position to 'NSImageOnly'
Set the button size to 40 x 25 as well as the min and max sizes of the ToolbarItem
The result is a toolbar that can look very simular to the Mail.app toolbar.
Thanks All - AYAL
One way to do it is to have your image actually be the button i.e. take up all of the button's canvas. You will have to use the button's setBordered: method so the button's border is not drawn.
you could make the button image in something like gimp or photoshop then use that as the background or image for the button.
i feel like your going to say "this is what im doing". and maybe you made the little mail icon but i mean for you to make the whole button, outline and everything, then use that for the button image. make sense?
like here, just use this as the background