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

# drawKnobSlot(in:highlight:)

Draws the portion of the scroller’s track, possibly including the line increment and decrement arrow buttons, that falls in the given rectangle.

```
func drawKnobSlot(in slotRect: NSRect, highlight flag: Bool)
```

## Parameters

`slotRect`

The rectangle in which to draw the knob slot.

`flag`

If `flag` is <doc://com.apple.documentation/documentation/Swift/true>, any scroll arrow button that falls within `slotRect` is drawn highlighted; otherwise it’s drawn normally.

## Discussion

Only one arrow button will be shown highlighted at a time, so you can expect this method to sometimes be invoked with a `slotRect` that encompasses only one arrow.

---

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)