views:

27

answers:

1

How can I display an NSAlert when an NSWindow attempts to close. This will also have to be turned on and off.

A: 

NSWindow's delegate has a windowShouldClose: method that will allow you to customize this. There's also NSWindow's documentEdited methods that let you mark a document as having unsaved changes, which might interest you.

Chuck