Re: Drawer-related problem
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.