<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSScroller/highlight(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScroller(im)highlight:"
  },
  "title" : "highlight(_:)"
}
-->

# highlight(_:)

Highlights or unhighlights the scroll button the user clicked.

```
func highlight(_ flag: Bool)
```

## Discussion

The receiver invokes this method while tracking the mouse; you should not invoke it directly. If `flag` is <doc://com.apple.documentation/documentation/Swift/true>, the appropriate part is drawn highlighted; otherwise it’s drawn normally.

### Special Considerations

This method has no effect in macOS 10.7 and later.

## See Also

[`func rect(for: NSScroller.Part) -> NSRect`](/documentation/AppKit/NSScroller/rect(for:))

Returns the rectangle occupied by `aPart`, which for this method is interpreted literally rather than as an indicator of scrolling direction.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)