Class

NSMenuItemCell

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

Declaration

@interface NSMenuItemCell : NSButtonCell

Overview

Topics

Configuring Menu-Item Attributes

menuItem

The menu item object associated with the cell.

Calculating the Size of a Menu Item

- calcSize

Calculates the minimum required width and height of the receiver’s menu item.

needsSizing

A Boolean value indicating whether the size of the menu needs to be calculated.

imageWidth

The width of the image associated with the menu item.

titleWidth

The width of the menu item’s text, measured in points.

keyEquivalentWidth

The width of the menu item’s key equivalent string.

stateImageWidth

The width of the image used to indicate the state of the menu item.

Getting the Menu Item’s Drawing Rectangle

- keyEquivalentRectForBounds:

Returns the rectangle into which the menu item’s key equivalent should be drawn.

- stateImageRectForBounds:

Returns the rectangle into which the menu item’s state image should be drawn.

- titleRectForBounds:

Returns the rectangle into which the menu item’s title should be drawn.

Drawing the Menu Item

- drawBorderAndBackgroundWithFrame:inView:

Draws the borders and background associated with the receiver’s menu item (if any).

- drawImageWithFrame:inView:

Draws the image associated with the menu item.

- drawKeyEquivalentWithFrame:inView:

Draws the key equivalent associated with the menu item.

- drawSeparatorItemWithFrame:inView:

Draws a menu item separator.

- drawStateImageWithFrame:inView:

Draws the state image associated with the menu item.

- drawTitleWithFrame:inView:

Draws the title associated with the menu item.

needsDisplay

A Boolean value indicating whether the menu item needs to be displayed.

Assigning a Tag

tag

The integer tag of the selected menu item.

Relationships

Inherits From

See Also

Views and Controls

NSForm

An NSForm object is a vertical matrix of NSFormCell objects to implement the fields.

Deprecated
NSFormCell

The NSFormCell class is used to implement text entry fields in a form. The left part of an NSFormCell object contains a title. The right part contains an editable text entry field.

NSBeginAlertSheet

Creates and runs an alert sheet.

Deprecated
NSBeginCriticalAlertSheet

Creates and runs a critical alert sheet.

Deprecated
NSBeginInformationalAlertSheet

Creates and runs an informational alert sheet.

Deprecated
NSGetAlertPanel

Returns an alert panel.

Deprecated
NSGetCriticalAlertPanel

Returns an alert panel to display a critical message.

Deprecated
NSGetInformationalAlertPanel

Returns an alert panel to display an informational message.

Deprecated
NSReleaseAlertPanel

Disposes of an alert panel.

Deprecated
NSRunAlertPanel

Creates an alert panel.

Deprecated
NSRunCriticalAlertPanel

Creates and runs a critical alert panel.

Deprecated
NSRunInformationalAlertPanel

Creates and runs an informational alert panel.

Deprecated
NSInputManagerDeprecated
NSInputServerDeprecated
NSDisableScreenUpdates

Disables screen updates.

Deprecated
NSEnableScreenUpdates

Enables screen updates.

Deprecated