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

# mouseExited(with:)

Erases the button’s border.

```
func mouseExited(with event: NSEvent)
```

## Parameters

`event`

The event object generated by the mouse movement.

## Discussion

This method is called only when the pointer moves off the button and the value of [`showsBorderOnlyWhileMouseInside`](/documentation/AppKit/NSButtonCell/showsBorderOnlyWhileMouseInside) is <doc://com.apple.documentation/documentation/Swift/true>.

---

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)