Re: Drawer-related problem
Re: Drawer-related problem
- Subject: Re: Drawer-related problem
- From: Matt Ridley <email@hidden>
- Date: Sat, 12 May 2001 03:57:04 +0100
On Saturday, May 12, 2001, at 01:15 am, mmalcolm crawford 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?
- (void)windowWillClose:(NSNotification *)aNotification
{
NSArray *drawers = [[aNotification object] drawers];
NSEnumerator *enumerator = [drawers objectEnumerator];
NSDrawer *drawer;
while (drawer = [enumerator nextObject])
[drawer close];
}
Hi Malcolm,
Thanks for your reply. The approach you detailed occurred to me,
but what I ended up doing was simply using Interface Builder to
set the window to "Release on close" (to be sent a release
message when it's closed). Since it's my app's only window, and
since I've already coded the app to quit when all windows are
closed, when it closes then it's always time to quit. The
release message gets rid of the drawer at the same time.
Best,
-Matt
--
Matt Ridley
<
http://www.mattridley.com/>