---
title: NSMenuItemCell
framework: appkit
role: symbol
role_heading: Class
path: appkit/nsmenuitemcell
---

# NSMenuItemCell

An object that handles the measurement and display of a single menu item in its encompassing frame.

## Declaration

```swift
class NSMenuItemCell
```

## Overview

Overview note: NSMenuItemCell is no longer used to draw menus. Using it does not affect the appearance of your menus.

## Topics

### Initializers

- [init(coder:)](appkit/nsmenuitemcell/init(coder:).md)
- [init(textCell:)](appkit/nsmenuitemcell/init(textcell:).md)

### Configuring Menu-Item Attributes

- [menuItem](appkit/nsmenuitemcell/menuitem.md)

### Calculating the Size of a Menu Item

- [calcSize()](appkit/nsmenuitemcell/calcsize().md)
- [needsSizing](appkit/nsmenuitemcell/needssizing.md)
- [imageWidth](appkit/nsmenuitemcell/imagewidth.md)
- [titleWidth](appkit/nsmenuitemcell/titlewidth.md)
- [keyEquivalentWidth](appkit/nsmenuitemcell/keyequivalentwidth.md)
- [stateImageWidth](appkit/nsmenuitemcell/stateimagewidth.md)

### Getting the Menu Item’s Drawing Rectangle

- [keyEquivalentRect(forBounds:)](appkit/nsmenuitemcell/keyequivalentrect(forbounds:).md)
- [stateImageRect(forBounds:)](appkit/nsmenuitemcell/stateimagerect(forbounds:).md)
- [titleRect(forBounds:)](appkit/nsmenuitemcell/titlerect(forbounds:).md)

### Drawing the Menu Item

- [drawBorderAndBackground(withFrame:in:)](appkit/nsmenuitemcell/drawborderandbackground(withframe:in:).md)
- [drawImage(withFrame:in:)](appkit/nsmenuitemcell/drawimage(withframe:in:).md)
- [drawKeyEquivalent(withFrame:in:)](appkit/nsmenuitemcell/drawkeyequivalent(withframe:in:).md)
- [drawSeparatorItem(withFrame:in:)](appkit/nsmenuitemcell/drawseparatoritem(withframe:in:).md)
- [drawStateImage(withFrame:in:)](appkit/nsmenuitemcell/drawstateimage(withframe:in:).md)
- [drawTitle(withFrame:in:)](appkit/nsmenuitemcell/drawtitle(withframe:in:).md)
- [needsDisplay](appkit/nsmenuitemcell/needsdisplay.md)

### Assigning a Tag

- [tag](appkit/nsmenuitemcell/tag.md)

## Relationships

### Inherits From

- [NSButtonCell](appkit/nsbuttoncell.md)

### Inherited By

- [NSPopUpButtonCell](appkit/nspopupbuttoncell.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSAccessibilityElementProtocol](appkit/nsaccessibilityelementprotocol.md)
- [NSAccessibilityProtocol](appkit/nsaccessibilityprotocol.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSUserInterfaceItemIdentification](appkit/nsuserinterfaceitemidentification.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Classes

- [NSOpenGLView](appkit/nsopenglview.md)
- [NSOpenGLContext](appkit/nsopenglcontext.md)
- [NSOpenGLLayer](appkit/nsopengllayer.md)
- [NSOpenGLPixelFormat](appkit/nsopenglpixelformat.md)
- [NSDrawer](appkit/nsdrawer.md)
- [NSForm](appkit/nsform.md)
- [NSFormCell](appkit/nsformcell.md)
