PDA

View Full Version : cocoa/interface builder question




DJPaul
Nov 1, 2007, 06:08 PM
Hi all, i'm new to Cocoa and Interface Builder (both on Leopard), so you'll have to excuse me.

I'm part way through designing the interface for an application that looks similar to mail.app - by that, I mean an NSOutlineView up the left hand side of the window, and the main content area to right. I've also got a toolbar running across the top of the window.

I want to add a mini-toolbar along the bottom of the window. I have seen these referred to as "bottom button bars" or "status bars" across the web. I would appreciate some pointers how to start doing this. e.g. this bar http://forums.finaljustice.co.uk/Picture%201.png) from Mail.


I've tried the obvious things - IB doesn't let me add > 1 toolbar to a window. I can't drag a window into another window, either (to try to get the background colour/texture of the panel). So... I created a Custom View along the bottom of the screen, and have written some code so it colours this view's area in a lovely green colour. ;)

I've dragged some buttons on top of my Custom View, which render on top - so essentially, this way would work if someone could tell me how I get the View to render the appropriate coloured background**. Unless this is the wrong approach? in which case pointers as to the "correct" method would be appreciated.


**By this I mean; what's the best/official/flavour of the week/most standard colour scheme now in Leopard? e.g. As far as I can see, it's between the Finder vs Mail - Finder has a much darker bar along the bottom of the window, whereas Mail has a much lighter one.
I am leaning towards the lighter version; either way, I would need to draw this texture/colour into my Custom View. How can I do this?

Many thanks for reading and for your help



kainjow
Nov 1, 2007, 11:11 PM
You can find examples of this UI here (http://www.mere-mortal-software.com/blog/details.php?d=2006-12-21) and here (http://blogs.roguesheep.com/2006/10/23/for-your-ui-pleasurerscontrols).

sdfilter
Nov 6, 2007, 06:00 AM
Yeah, the change from IB 2 to IB 3 is driving me nuts. I'm working my way through Hillegass, and really struggling to make the change.

For example, in the discussion of CustomViews, he describes the process of generating the files for the class and then extending them. However, I can't figure out the process in IB 3. The classes tab is gone, so the process has changed pretty significantly. The best I've come up with:

1. Drag a CustomView.
2. From File menu, Write Class Files
3. Go to X Code and manually add the generated files to the project.
4. Inspect the generated header file and realize that it doesn't even extend NSView, so manually add all the "stuff" that used to be generated by IB 2.

Clearly I'm doing this incorrectly, but I can't find any guidance regarding the correct approach.

devman
Nov 6, 2007, 08:40 AM
Yeah, the change from IB 2 to IB 3 is driving me nuts. I'm working my way through Hillegass, and really struggling to make the change.

For example, in the discussion of CustomViews, he describes the process of generating the files for the class and then extending them. However, I can't figure out the process in IB 3. The classes tab is gone, so the process has changed pretty significantly. The best I've come up with:

1. Drag a CustomView.
2. From File menu, Write Class Files
3. Go to X Code and manually add the generated files to the project.
4. Inspect the generated header file and realize that it doesn't even extend NSView, so manually add all the "stuff" that used to be generated by IB 2.

Clearly I'm doing this incorrectly, but I can't find any guidance regarding the correct approach.

http://developer.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/ConnectionsandBindings/chapter_6_section_3.html#//apple_ref/doc/uid/TP40005344-CH7-SW31

sdfilter
Nov 6, 2007, 11:02 AM
Thanks Devman. I clearly got a bit ahead of myself and skimmed the docs too quickly. Don't know how I managed to miss this.