English 中文(简体)
人口动态 2. NSOutline的单元菜 观点
原标题:Dynamically populated NSPopUpButtonCell menu in an NSOutlineView

I'm working with an NSOutline 观点,分两栏。 我的<代码>数据表 提供显示档案类型(即你与一架通用公平市)的定制类别物品树种的提纲。 第1栏是档案类型显示名称(例如“Source代码”、“Interface Buildinger NIB文件”)。 第二栏是,该编码应允许用户为特定文件类型(Xcode's “Filetypes” favor pane的思考,而您的偏差很大)。

我可以为树中的某个特定项目制作一个NSMenu,该编码载有根据发射服务数据库条目编制的、与相关的应用icon等内容相配套的备选办法。 事实上,菜单本身的工作是 wonder的,通过<条码>有人居住。 NSPopUpButtonCellWillPopUpNotification

问题在于,正如我可能的那样,当Mendu isn't poppeds始终含有两条内容中的一条:要么是空洞,要么是单元的缺省案文,要么是关于该项目的<代码>-handlerName(分配给该栏的属性)的结果不是nil,后者。

此外,我人工打上<代码>-selectItem: on the NSPopUpButtonCell instance,这似乎只是Wrong。 相比之下,左手栏仅是,所有只是工程(虽然得到批准,但所有工程都用在该项目的价值上,并注明。

(争端: 我在Cocoa UI公司中说得很新;我知道目标-C,了解其他方案语言的很多,但我并没有积累大量经验,建设Macupers XUIs,因此是gent。

问题回答

由于我也对意见提纲和民团表示担忧,我很想知道对这个问题和许多其他问题的答复。 恐怕我确实能够帮助你,但一件事的确听了我的眼睛:

我可以为树中的某个特定项目生产一个NSMenu。

在过去的几个星期里,我曾学习过一件事:当与一名NSTreeController和一名数据来源合作时,我总是提供NSTreeNodes确定你的真正目标(在本案中为NSMenu)。





相关问题
2 mysql instances in MAC

i recently switched to mac. first and foremost i installed xampp. then for django-python-mysql connectivity, i "somehow" ended up installing a seperate MySQL. now the seperate mysql installation is ...

Iterating over string/strlen with umlauted characters

This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...

Controlling OSX windows

I m trying to control windows of a foreign OSX applications from my application. I d like to 1. move the windows on the screen 2. resize the windows on the screen 3. change the currently active window ...

Switching J2SE versions on Mac OS (SnowLeopard)

My current JDK on Mac OS (10.6) is set to 1.6 and I d like to switch to 1.5. A listing of /System/Library/Frameworks/JavaVM.framework/Versions/ shows: lrwxr-xr-x 1 root wheel 10 Nov 3 18:34 ...

Scrolling inside Vim in Mac s Terminal

I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...

export to MP3 from quicktime API

A question for Apple,QT programmers. Would like to know if it s possible to export a Movie object to MP3 using the QuickTime API. Preferably the ConvertMovieToFile function. I ve looked at ...

热门标签