Re: Trapping the close click?
Re: Trapping the close click?
- Subject: Re: Trapping the close click?
- From: Ryan Stevens <email@hidden>
- Date: Wed, 28 May 2003 07:46:06 -0700
On Wednesday, May 28, 2003, at 06:27 AM, Matthew Weinstein wrote:
Does anyone out there know if there is a way to "trap" the close
click, i.e., have it send a message to something other than
performClose?
This should work...
id closeButton = [yourWindow standardWindowButton:NSWindowCloseButton ];
[closeButton setAction:@selector(yourActionMethod:)];
[closeButton setTarget:self];
Standard warning: Be careful not to "break" it. Everyone expects that
clicking the close button will close the window. ;-)
That's assuming you weren't really looking for
NSWindowWillCloseNotification.
HTH!
_______________________________________________
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.