简体   繁体   English

NSMenuItem中的NSTextField

[英]NSTextField in NSMenuItem

Hi am writing small app for posting twitts on twitter.com I manage to create statusbar icon next to clock and battery monitor, but now I am stacked... 嗨,我正在编写一个用于在twitter.com上发布twitt的小应用程序,我设法在时钟和电池监视器旁边创建statusbar图标,但是现在我被堆积了...

I wanted to add menu item text area max length of 140 chars, (4-5 rows text input field) something like spotlight but multi-rows 我想添加菜单项文本区域,最大长度为140个字符,(4-5行文本输入字段)类似Spotlight但多行

(BTW I have got working class, to put and get twitts on twitter, and return its as a NSString, and it works) (顺便说一句,我有工人阶级,在推特上放推特,然后以NSString的形式返回它,它就可以了)

Is it possible, or I have to implement my own "something" which appears, or I can use menu items 是否可能,或者我必须实现自己出现的“内容”,或者可以使用菜单项

I add menuitems like this: 我添加如下菜单项:

  menuItem = [menu addItemWithTitle:@"Menu Item Tilte"
                             action:@selector(CallbackFunction:)
                      keyEquivalent:@""];

 [menuItem setTarget:self];

next problem will be auto-generating menu items with followed twitts, but I think it won't be a problem (it is similar to wifi statusbar icon, which populates list automatically) 下一个问题将是自动生成带有以下twitt的菜单项,但我认为这不会有问题(这类似于wifi statusbar图标,该图标会自动填充列表)

You can embed any NSView into a menu. 您可以将任何NSView嵌入菜单。 See the -setView: method of NSMenuItem. 请参见NSMenuItem的-setView:方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM