This action method simulates the user clicking the close button by momentarily highlighting the button and then closing the window.
- macOS 10.0+
The message’s sender.
If the window’s delegate or the window itself implements
window, that message is sent with the window as the argument. (Only one such message is sent; if both the delegate and the
NSWindow object implement the method, only the delegate receives the message.) If the
window method returns
NO, the window isn’t closed. If it returns
YES, or if it isn’t implemented,
perform invokes the
close method to close the window.
If the window doesn’t have a close button or can’t be closed (for example, if the delegate replies
NO to a
window message), the system emits the alert sound.