---
title: "drawStatusBarBackground(in:withHighlight:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsstatusitem/drawstatusbarbackground(in:withhighlight:)"
---

# drawStatusBarBackground(in:withHighlight:)

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

## Declaration

```swift
func drawStatusBarBackground(in rect: NSRect, withHighlight highlight: Bool)
```

## Parameters

- `rect`: A rectangle defining the area of a custom status-bar item.
- `highlight`: doc://com.apple.documentation/documentation/Swift/true to draw the background pattern in the standard highlight pattern, doc://com.apple.documentation/documentation/Swift/false to not highlight the pattern.

## Discussion

Discussion You can use this method to help a custom status-bar item emulate the behavior of a standard item.

## See Also

### Deprecated

- [isEnabled](appkit/nsstatusitem/isenabled.md)
- [target](appkit/nsstatusitem/target.md)
- [action](appkit/nsstatusitem/action.md)
- [doubleAction](appkit/nsstatusitem/doubleaction.md)
- [sendAction(on:)](appkit/nsstatusitem/sendaction(on:).md)
- [popUpMenu(_:)](appkit/nsstatusitem/popupmenu(_:).md)
- [title](appkit/nsstatusitem/title.md)
- [attributedTitle](appkit/nsstatusitem/attributedtitle.md)
- [image](appkit/nsstatusitem/image.md)
- [alternateImage](appkit/nsstatusitem/alternateimage.md)
- [highlightMode](appkit/nsstatusitem/highlightmode.md)
- [toolTip](appkit/nsstatusitem/tooltip.md)
- [view](appkit/nsstatusitem/view.md)
