NSMenuView

NSMenuView Mac OS X 10.0

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.

figs/cocn_1551.gif

@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)isHorizontal;
   - (BOOL)isTornOff;
   - (void)itemAdded:(NSNotification *)notification;
   - (void)itemChanged:(NSNotification *)notification;
   - (void)itemRemoved:(NSNotification *)notification;
   - (float)keyEquivalentOffset;
   - (float)keyEquivalentWidth;
   - (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu;
   - (NSMenuItemCell *)menuItemCellForItemAtIndex:(int)index;
   - (void)performActionWithHighlightingForItemAtIndex:(int)index;
   - (NSRect)rectOfItemAtIndex:(int)index;
   - (void)sizeToFit;
   - (float)stateImageOffset;
   - (float)stateImageWidth;
   - (BOOL)trackWithEvent:(NSEvent *)event;
   - (void)update;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes