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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to