• 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: Drawer-related problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawer-related problem


  • Subject: Re: Drawer-related problem
  • From: mmalcolm crawford <email@hidden>
  • Date: Sat, 12 May 2001 01:15:33 +0100

Matt Ridley wrote:

I have a drawer attached to a window. Via my main controller class, I've implemented the applicationShouldTerminateAfterLastWindowClosed method, so that my app quits when the window closes. This works fine, unless the drawer is open at the time. Any ideas what I can do to make sure the app always quits when that window closes, as it did before I added the drawer?

Close the drawer...
Make a window delegate:

- (void)windowWillClose:(NSNotification *)aNotification
{
NSArray *drawers = [[aNotification object] drawers];
NSEnumerator *enumerator = [drawers objectEnumerator];
NSDrawer *drawer;

while (drawer = [enumerator nextObject]) {
[drawer close];
}
}

You might want to store the state of the drawer in case the window might be opened again and you want to restore the drawer to its original state.

mmalc.


  • Follow-Ups:
    • Re: Drawer-related problem
      • From: Matt Ridley <email@hidden>
    • Re: Drawer-related problem
      • From: Michael Tsai <email@hidden>
References: 
 >Drawer-related problem (From: Matt Ridley <email@hidden>)

  • Prev by Date: Re: Opposite of delegate?
  • Next by Date: Re: Drawer-related problem
  • Previous by thread: Drawer-related problem
  • Next by thread: Re: Drawer-related problem
  • Index(es):
    • Date
    • Thread