• 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: Knowing when window closed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Knowing when window closed


  • Subject: Re: Knowing when window closed
  • From: Nathan Day <email@hidden>
  • Date: Tue, 30 Jul 2002 16:07:09 +0930

If you're windows have delegate (WindowController) you can implement the method

- (void)windowWillClose:(NSNotification *)aNotification

or if for some reason you want to do something after the window is closed in you windowController you could try overriding the close method.

- (void)close
{
[super close];
// do your stuff here
}

you can also listen for NSWindowWillCloseNotification anywhere in your app, your notification method will be passed the window that will close, so you can test it to see if it is the one your interested in or set up notifications for only the windows you are interested in.

Again if you need to know after closing you could override the close method in your windowController and then post your own notification.

-

On Wednesday, July 31, 2002, at 06:53 AM, Aidas wrote:

Hi,

I want to know and handle closing of two windows called "first" and
"second". How could I do this? If you can please add example too.


Thank you


Aidas

Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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.

References: 
 >Knowing when window closed (From: Aidas <email@hidden>)

  • Prev by Date: Printing images always puts image in corner...
  • Next by Date: Re: More efficient solution than DO?
  • Previous by thread: Knowing when window closed
  • Next by thread: Re: Knowing when window closed
  • Index(es):
    • Date
    • Thread