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:
How can I use that menubar in my application? Thanks.
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:
How can I use that menubar in my application? Thanks.
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.
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?
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.