gpt4 book ai didi

macos - [NSMenuItemCell menuView] 和 [NSMenuItemCell setMenuView] 的 64 位替换

转载 作者:行者123 更新时间:2023-12-03 16:49:26 25 4
gpt4 key购买 nike

NSMenuItemCell 的两个方法 -[NSMenuItemCell menuView]-[NSMenuItemCell setMenuView:] 的 64 位替代是什么类(class)?我怎样才能获得相同的结果?

最佳答案

NSMenuItemCellNSMenuView 从未在 Mac OS X 的任何发行版本中用于绘制菜单。以下是 Mac OS X 开发人员发行说明的摘录:

Notes specific to MacOS X Developer Preview 3

Menu

The implementation of menus has changed drastically; NSMenuView and NSMenuItemCell are no longer used, -[NSMenu menuRepresentation] now returns nil, and tear off menus are no longer available. For Developer Preview 3, there is no support for menu item images. If there is no text in the menu item, a placeholder text consisting of "< image >" or "< image name >" will be inserted instead. Menu item state images are not supported either and in their place the standard checkbox or dash for on and mixed states are used.

(我不确定预公开测试版 Mac OS X 的确切时间表,但对于“开发者预览版 3”,我猜我们正在谈论 1990 年代末期)。

有关当前如何实现菜单的更多信息,请参阅 Application Menu and Pop-up List Programming Topics: How Menus Work

正如一二三提到的,您使用 NSMenuNSMenuItem 来实现菜单。在 OS X 10.5 及更高版本中,您可以使用 -setView: 方法在 NSMenuItem 中使用自定义 NSView 实例。

关于macos - [NSMenuItemCell menuView] 和 [NSMenuItemCell setMenuView] 的 64 位替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7459926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com