3

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...

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

(BTW I have got working class, to put and get twitts on twitter, and return its as a NSString, and it works)

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)

Matt Harasymczuk
  • 1,728
  • 2
  • 21
  • 29
  • 1
    Did you manage to receive keydowns in the textfield of your ```NSMenuItem```? As the docs state, views attached as the menu item's view do not receive key press events :(. – Raffael Nov 06 '13 at 17:26

1 Answers1

7

You can embed any NSView into a menu. See the -setView: method of NSMenuItem.

NSResponder
  • 16,861
  • 7
  • 32
  • 46