user142019
user142019

Reputation:

Using the `Main Menu` from a CIB

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 http://wearesakuzaku.com/blog/wp-content/uploads/2007/11/9-mainmenu-nib-opened-in-interface-builder.jpg

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

Upvotes: 0

Views: 441

Answers (3)

Ross Boucher
Ross Boucher

Reputation: 702

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.

Upvotes: 0

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?

Upvotes: 0

Evadne Wu
Evadne Wu

Reputation: 3200

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.

Upvotes: 1

Related Questions