Re: How a window was closed?
Re: How a window was closed?
- Subject: Re: How a window was closed?
- From: Jens Alfke <email@hidden>
- Date: Tue, 2 Mar 2010 15:42:46 -0800
On Mar 2, 2010, at 3:32 PM, Eric Gorr wrote:
Is there any way to determine how a window was closed?
I need to base what I do on whether or not a window will be closed
by the user pressing the close (red) button or some other way.
If you have an NSWindow subclass, you can override -performClose:,
which is called when the user takes action to close the window.
Otherwise, you can make your class implement the NSWindow delegate
method -windowShouldClose:, which will also be called when the user
tries to close the window. Return YES if the window should close, NO
if it shouldn't.
—Jens_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden