Re: Trapping window close event
Re: Trapping window close event
- Subject: Re: Trapping window close event
- From: Stéphane Sudre <email@hidden>
- Date: Wed, 19 Mar 2003 12:18:57 +0100
On Wednesday, March 19, 2003, at 11:57 AM, Suman Ganguly wrote:
Hi All,
In my application I want to close the application as soon as the user
clicks
on the close button (appearing on the left top corner of the window)
of the
application window.
Is there any event or something else to trap that event? Any
suggestion will
be highly appreciated.
Set the delegate of the window to be your controller (either via IB or
setDelegate: in your code) and implement this method in the controller:
- (void)windowWillClose:(NSNotification *)aNotification
{
[NSApp terminate:self];
}
_______________________________________________
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.