• 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: Keeping closed windows in the Window menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Keeping closed windows in the Window menu
      • From: Andreas Eriksson <email@hidden>
References: 
 >Keeping closed windows in the Window menu (From: Andreas Eriksson <email@hidden>)

  • Prev by Date: Re: Keeping closed windows in the Window menu
  • Next by Date: Re: Use NSDocument as a variable of another NSDocument
  • Previous by thread: Re: Keeping closed windows in the Window menu
  • Next by thread: Re: Keeping closed windows in the Window menu
  • Index(es):
    • Date
    • Thread