Is it possible to get an event when you click on a token in a NSTokenField?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Seeing as those tokens (NSTokenFieldCell
s) inherit from the NSCell
class, in theory, yes, you can have them send an event by giving them an action and a target (-setAction:
and -setTarget:
respectively, and if you want to give the tokens menus when pressed, use -setMenu:
).