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: Quincey Morris <email@hidden>
- Date: Mon, 18 Jan 2010 13:04:56 -0800
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;
}
_______________________________________________
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