views:

28

answers:

1

How can I Display an NSTextField or an NSProgressIndicator within an NSMenu? I'm looking to do something similar to the Spotlight icon menu, or the Help menu of most applications.

+1  A: 

You can use the [NSMenu - setView:] method for it. But you can't add an NSTextField without major hacks. Apple still uses a brain dead Carbon implementation for menus. If you want keystrokes you have to go down into Carbon and do some magic for key handling.

Its so worse you will not even get a menu action fired if the user selects the menu item with the return key.

For this reason the official Apple sample just shows a slider as an embedded menu.

Please raise this topic on the official apple mailing list so Apple can see that this is a wanted feature and will be fixed soon.

Lothar
Better yet, file bugs: https://bugreport.apple.com/
Peter Hosey