How can I find out that NSWindow was closed using the close button?

Is there an easy way to find out when NSWindow was closed using the close button (in the window title bar).

Using the NSWindowDelegateand method windowWillClose:(NSNotification *)notification, I get a notification about every close. But how can I find out that the close request was sent by the close button.

+5
source share
1 answer

Use [yourWindow standardWindowButton:NSWindowCloseButton]to find the close button, then change its purpose and action to your own method.

+14
source

All Articles