Re: Re: Hide a window on close?
Re: Re: Hide a window on close?
- Subject: Re: Re: Hide a window on close?
- From: "Craig Dooley" <email@hidden>
- Date: Thu, 14 Sep 2006 14:21:42 -0400
I was able to get the behavior I was looking for with
- (BOOL)windowShouldClose:(id)sender {
[[NSApplication sharedApplication] hide:self];
return NO;
}
-Craig
On 9/14/06, j o a r <email@hidden> wrote:
On 14 sep 2006, at 19.37, Craig Dooley wrote:
> Should I make a delegate for windowShouldClose: that hides the window
> and returns NO?
Yes, something like this would probably work:
- (BOOL) windowShouldClose:(id) sender
{
[[self window] performSelector: @selector(orderOut:) afterDelay: 0.0];
return NO;
}
It's possible that you don't have to delay the call to "-orderOut:",
but it seems safer to do that, compared with outright closing the
window from a callback of another attempt to close the window...
j o a r
--
-----------------------------------------------------------------------
Craig Dooley <email@hidden>
--
-----------------------------------------------------------------------
Craig Dooley <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden