Re: Newbie: Prompt Before Quitting
Re: Newbie: Prompt Before Quitting
- Subject: Re: Newbie: Prompt Before Quitting
- From: Esteban Uribe <email@hidden>
- Date: Wed, 09 Apr 2003 13:43:48 -0700
Hi Chad,
On Wednesday, April 09, 2003, at 11:39AM, Chad Eckles <email@hidden> wrote:
>
Hello All Can someone show me how to Prompt the User if he Wants to Quite or
>
not when he Closes the Window?
Sure, make your controller class a delegate of NSWindow, and implement
the delegate method - (BOOL)windowShouldClose:(id)sender
Then do your stuff there (call an NSRunAlertPanel, if user says yes [NSApp terminate: nil])
Check out the documentation for it:
NSWindow
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSWindow.html#BCIDCAHJ>
NSRunAlertPanel
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Functions/AppKitFunctions.html>
NSApplication
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSApplication.html>
-Esteban
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.