How do you detect when a user clicks the green maximize or zoom (+) button on the NSWindow without using the NSWindowDidResizeNotification
?
The reason I don't want to use NSWindowDidResizeNotification
is because that is also triggered repeatedly as the user clicks and drags to manually resize the window. I have some code that I want to execute and it should only fire once when the user zooms or de-zooms the window using the green button in the top left-hand corner and not many times when manually resizing the window.
These two window delegate methods may be useful:
- windowWillUseStandardFrame:defaultFrame:
- windowShouldZoom:toFrame:
You might also consider subclassing NSWindow and overriding the zoom:
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With