0

我正在创建一个卡布奇诺应用程序,并且我有一个带有菜单栏的 CIB 文件(来自 IB 的主菜单 XIB 模板)。很像这个:

替代文字 http://wearesakuzaku.com/blog/wp-content/uploads/2007/11/9-mainmenu-nib-opened-in-interface-builder.jpg

如何在我的应用程序中使用该菜单栏?谢谢。

4

3 回答 3

1

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.

于 2010-04-19T10:26:13.710 回答
0

如果要将主菜单添加到现有 nib,只需将菜单对象拖到顶级对象栏中,然后将其连接为 Application 对象的 MainMenu 出口。

于 2010-04-26T16:18:22.070 回答
0

是的,如果您使用如上所示的“-t NibApplication”创建您的应用程序,菜单栏应该会自动显示。不是吗?或者你在问什么不同的东西?

于 2010-04-23T06:38:24.523 回答