Class

NSStatusItem

The NSStatusItem class represents the individual elements displayed within an NSStatusBar object. Instances are created by the NSStatusBar method statusItem(withLength:), which automatically adds the new status item to the status bar. The appearance and behavior of the status item are then set using the button property. (For additional guidance, see Menu Bar Extras.)

Symbols

Getting the Item’s Status Bar

var statusBar: NSStatusBar

The status bar in which the status item is displayed.

Managing the Status Item’s Behavior

var button: NSStatusBarButton?

The button that is displayed in the status bar.

var menu: NSMenu?

The pull-down menu that is displayed when the status item is clicked.

Configuring the Status Item’s Appearance

var length: CGFloat

The amount of space in the status bar that should be allocated to the status item.

Deprecated

var isEnabled: Bool

A Boolean that indicates whether the status item is enabled to respond to clicks.

Deprecated
var target: AnyObject?

The target object to which the status item’s action message is sent when the status item is clicked.

Deprecated
var action: Selector?

The selector that is sent to the status item’s target when the status item is clicked.

Deprecated
var doubleAction: Selector?

The selector that is sent to the status item’s target when the status item is double-clicked.

Deprecated
func sendAction(on: NSEventMask)

Sets the conditions on which the status item sends action messages to its target.

Deprecated
func popUpMenu(NSMenu)

Displays a menu under a custom status bar item.

Deprecated
var title: String?

The string that is displayed at the status item’s position in the status bar.

Deprecated
var attributedTitle: NSAttributedString?

The attributed string that is displayed at the status item’s position in the status bar.

Deprecated
var image: NSImage?

The image that is displayed at the status item’s position in the status bar.

Deprecated
var alternateImage: NSImage?

The alternate image to be displayed when a status bar item is highlighted.

Deprecated
var highlightMode: Bool

A Boolean that indicates whether the status item is highlighted when it is clicked.

Deprecated
var toolTip: String?

The tool tip string that is displayed when the cursor pauses over the status item.

Deprecated
var view: NSView?

The custom view that is displayed at the status item’s position in the status bar.

Deprecated
func drawStatusBarBackground(in: NSRect, withHighlight: Bool)

Draws the menu background pattern for a custom status-bar item in regular or highlight pattern.

Deprecated

Relationships

Inherits From

Conforms To