---
title: NSHighlightRect
framework: appkit
role: symbol
role_heading: Function
path: appkit/nshighlightrect
---

# NSHighlightRect

Highlights the specified rect by filling it with white.

## Declaration

```occ
extern void NSHighlightRect(NSRect rect);
```

## Parameters

- `rect`: The bounding rectangle (in the current coordinate system) in which to draw.

## Discussion

Discussion Highlights the rectangle referred to by aRect. Light gray becomes white, and white becomes light gray. This function must be called twice, once to highlight the rectangle and once to unhighlight it; the rectangle should not be left in its highlighted state. When not drawing on the screen, the compositing operation is replaced by one that fills the rectangle with light gray.

## See Also

### Drawing Rectangles

- [NSFrameRect](appkit/nsframerect.md)
- [NSFrameRectWithWidth](appkit/nsframerectwithwidth.md)
- [NSFrameRectWithWidthUsingOperation](appkit/nsframerectwithwidthusingoperation.md)
- [NSEraseRect(_:)](appkit/nseraserect(_:).md)
- [NSRectFill](appkit/nsrectfill.md)
- [NSRectFillList](appkit/nsrectfilllist.md)
- [NSRectFillListUsingOperation](appkit/nsrectfilllistusingoperation.md)
- [NSRectFillListWithColors](appkit/nsrectfilllistwithcolors.md)
- [NSRectFillListWithColorsUsingOperation](appkit/nsrectfilllistwithcolorsusingoperation.md)
- [NSRectFillListWithGrays](appkit/nsrectfilllistwithgrays.md)
- [NSRectFillUsingOperation](appkit/nsrectfillusingoperation.md)
- [NSDrawTiledRects(_:_:_:_:_:)](appkit/nsdrawtiledrects(_:_:_:_:_:).md)
- [NSDrawGroove(_:_:)](appkit/nsdrawgroove(_:_:).md)
