Re: Keeping closed windows in the Window menu
Re: Keeping closed windows in the Window menu
- Subject: Re: Keeping closed windows in the Window menu
- From: Andreas Eriksson <email@hidden>
- Date: Mon, 18 Jan 2010 22:24:29 +0100
On Mon, Jan 18, 2010 at 10:04 PM, Quincey Morris
<email@hidden> wrote:
> On Jan 18, 2010, at 11:23, Andreas Eriksson wrote:
>
>> What's the recommended way of keeping a window in the Window menu
>> (like e.g. Address book and iChat does) so that it can be brought back
>> even after it has been closed?
>
> Here's the code (in the window controller) I use to do this:
>
> - (void) orderOutMyWindow: (id) sender {
> NSString* title = self.window.title;
> [self.window orderOut: sender];
> [NSApp addWindowsItem: self.window title: title filename: NO];
> }
>
> - (BOOL) windowShouldClose: (id) sender {
> [self performSelector: @selector (orderOutMyWindow:) withObject: sender afterDelay: 0.0];
> return NO;
> }
Thanks! Why is it necessary to delay the orderOutMyWindow invocation
with performSelector?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden