PDA

View Full Version : Interface Builder 2.5 toolbars???




Drew017
Dec 13, 2011, 04:04 PM
Hello- I'd like to know how to add a toolbar to a window in interface builder 2.5. For some reason, there is no NS toolbar in version 2.5, and I'd like to know how to get a toolbar in a window. In the item inspector, there is a unify toolbar option, but no toolbar. Help!??



kainjow
Dec 13, 2011, 06:19 PM
You could try this:
http://www.belkadan.com/generictoolbar/

Drew017
Dec 13, 2011, 07:15 PM
I tried that, but I can't get it to work, or maybe I don't know how... Can someone help!?

szymczyk
Dec 14, 2011, 02:10 PM
If kainjow's suggestion didn't work, you'll have to create the toolbar in your code. Apple didn't add toolbar support to Interface Builder until Xcode 3.

Drew017
Dec 14, 2011, 04:12 PM
where do I add the code?

szymczyk
Dec 14, 2011, 05:28 PM
I have never created a toolbar programmatically, but I guess you would add the code to the awakeFromNib: method or to the window's initialization code. The following article may help you:

NSToolbar Basics (http://www.dikant.de/2007/09/05/nstoolbar-basics)

Drew017
Dec 17, 2011, 12:20 PM
I'm new to programming, and I'd like to know where I need to put the code to create a toolbar

szymczyk
Dec 17, 2011, 01:38 PM
The article I linked to in my last post tells you where to put the code. If you're new to programming, I recommend starting with something simpler than programming a toolbar. The following article should help you:

Getting Started with Mac Programming (http://meandmark.com/blog/2010/01/getting-started-with-mac-programming/)

Blakeasd
Dec 17, 2011, 01:38 PM
Read Learning Objective-C: A Primer (https://developer.apple.com/library/mac/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/_index.html#//apple_ref/doc/uid/TP40007594)

Then Read Your First Mac App (https://developer.apple.com/library/mac/#documentation/General/Conceptual/Mac101/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40010611)

Then the NSToolbar Guide might make more sense