• 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: Re: Hide a window on close?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Hide a window on close? (From: "Craig Dooley" <email@hidden>)
 >Re: Hide a window on close? (From: j o a r <email@hidden>)

  • Prev by Date: Re: how to get events from a carbon event handler, in a cocoa app.
  • Next by Date: Re: Hide a window on close?
  • Previous by thread: Re: Hide a window on close?
  • Next by thread: Re: Hide a window on close?
  • Index(es):
    • Date
    • Thread