O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSMenuView — Mac OS X 10.0

Synopsis

This subclass of NSView is used to draw menus. Like NSMenuItemCell, this class has been deprecated, and should not be used in new code. You should use the APIs provided by NSMenu and NSMenuItem instead.

image with no caption

@interface NSMenuView : NSView
                                  // Initializers
   - (id)initAsTearOff;
   - (id)initWithFrame:(NSRect)frame;
                                  // Accessor Methods
   - (void)setWindowFrameForAttachingToRect:(NSRect)screenRect
                                 onScreen:(NSScreen *)screen 
                                 preferredEdge:(NSRectEdge)edge 
                                 popUpSelectedItem:(int)selectedItemIndex;
   - (void)setHorizontalEdgePadding:(float)pad;
   - (float)horizontalEdgePadding;
   - (void)setNeedsDisplayForItemAtIndex:(int)index;
   - (void)setNeedsSizing:(BOOL)flag;
   - (BOOL)needsSizing;
   - (void)setHighlightedItemIndex:(int)index;
   - (int)highlightedItemIndex;
   - (void)setHorizontal:(BOOL)flag;
   - (void)setMenu:(NSMenu *)menu;
   - (NSMenu *)menu;
   - (void)setFont:(NSFont *)font;
   - (NSFont *)font;
   - (void)setMenuItemCell:(NSMenuItemCell *)cell 
                                 forItemAtIndex:(int)index;
                                  // Class Methods
   + (float)menuBarHeight;
                                  // Instance Methods
   - (void)attachSubmenuForItemAtIndex:(int)index;
   - (NSMenu *)attachedMenu;
   - (NSMenuView *)attachedMenuView;
   - (void)detachSubmenu;
   - (float)imageAndTitleOffset;
   - (float)imageAndTitleWidth;
   - (int)indexOfItemAtPoint:(NSPoint)point;
   - (NSRect)innerRect;
   - (BOOL)isAttached;
 - (BOOL) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required