views:

136

answers:

3

I'm creating a Cappuccino Application, and I have a CIB file with a menubar (from IB's Main Menu XIB template). Much like this one:

alt text

How can I use that menubar in my application? Thanks.

+1  A: 

You’ll create an application using the NibApplication template by:

$ capp gen myApplication -t NibApplication -f

where the -f makes a symbolic link to your custom-built Cappuccino framework, instead of copying one in your bundle. After creating that application you’ll find MainMenu.cib.

Dump Info.plist and see that there’s a Main Cib file base name. In ordinary Cappuccino apps, we have CPApplicationDelegateClass instead (which, I am pretty sure, could also load any Cib by code).

The usage of a menu bar is identical to a Cocoa menu bar. Check Apple’s Application Menu and Pop-up List Programming Topics for Cocoa, or run $ jake docs within your Cappuccino installation, and check out its own documentation.

Evadne Wu
A: 

Yes, if you created your app using "-t NibApplication" as shown above, the menu bar should show up automatically. Is it not? Or are you asking something different?

Francisco Ryan Tolmasky I
No it isn't, and I'm not planning to create the entire project all over just fur a stupid menu bar :(
Time Machine
No one is asking you to do that either, just trying to clarify the problem. Is the screenshot above the nib in question? In other words, does the nib have multiple menus (I ask so I can try to reproduce the problem on my end). Alternatively, you could email me the nib file in question and I could try to debug it on my end.
Francisco Ryan Tolmasky I
A: 

If you want to add a main menu to an existing nib, you just have to drag a menu object into the top level objects bar, and then connect it as the MainMenu outlet of the Application object.

Ross Boucher