• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trapping the close click?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Trapping the close click?
      • From: Dustin Voss <email@hidden>
References: 
 >Trapping the close click? (From: Matthew Weinstein <email@hidden>)

  • Prev by Date: Re: Forwarding to mimic multiple inheritance
  • Next by Date: RE: lingering icon problem
  • Previous by thread: Trapping the close click?
  • Next by thread: Re: Trapping the close click?
  • Index(es):
    • Date
    • Thread