---
title: "setOnMouseExited(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscursor/setonmouseexited(_:)"
---

# setOnMouseExited(_:)

Sets whether the receiver accepts mouseExited(with:) events.

## Declaration

```swift
func setOnMouseExited(_ flag: Bool)
```

## Parameters

- `flag`: doc://com.apple.documentation/documentation/Swift/true if the receiver accepts future doc://com.apple.appkit/documentation/AppKit/NSCursor/mouseExited(with:) event messages; otherwise it ignores them.

## Discussion

Discussion Accepting mouseExited(with:) event messages allows the cursor to be made the current cursor when the cursor exits a view’s cursor rectangle.

## See Also

### Deprecated

- [init(image:foregroundColorHint:backgroundColorHint:hotSpot:)](appkit/nscursor/init(image:foregroundcolorhint:backgroundcolorhint:hotspot:).md)
- [mouseEntered(with:)](appkit/nscursor/mouseentered(with:).md)
- [setOnMouseEntered(_:)](appkit/nscursor/setonmouseentered(_:).md)
- [isSetOnMouseEntered](appkit/nscursor/issetonmouseentered.md)
- [mouseExited(with:)](appkit/nscursor/mouseexited(with:).md)
- [isSetOnMouseExited](appkit/nscursor/issetonmouseexited.md)
