• 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: NSPanel should not close on command-W
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPanel should not close on command-W


  • Subject: Re: NSPanel should not close on command-W
  • From: Jason Stephenson <email@hidden>
  • Date: Sat, 21 Jun 2008 14:19:32 -0400

Georg Seifert wrote:

I cannot reproduce this. If I close all documents in Textedit (or any other Mac-App) the font panel stays there and I get a NSBeep on hitting command-w.

According to what I read in the docs and what I've experienced in my own applications, panels don't respond to Command-W. They will close if you hit the <ESC> key.


Also, I do believe that if your panel is in the nib with your window controller's window (in a document-based application that would be MyDocument.nib), then the panel will close when the last window referencing the nib is closed, because the window controller is responsible for tearing down the top level objects loaded from the nib, which MyDocument : NSDocument will do, and any custom window controller should do by sending itself -autorelease in -windowWillClose.

So, I think, as Marco Masser has already mentioned, that if you want your panel to be independent of your document window's window controller, you'll need to put the panel in its own nib and load it independently.

You *might* be able to do some "magic" in your window controller's -windowWillClose method to give your panel a new owner. I don't know for sure: I haven't actually tried this.

HtH,
Jason
_______________________________________________

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: NSPanel should not close on command-W
      • From: Georg Seifert <email@hidden>
References: 
 >Re: NSPanel should not close on command-W (From: Keary Suska <email@hidden>)
 >Re: NSPanel should not close on command-W (From: Georg Seifert <email@hidden>)

  • Prev by Date: Re: NSPanel should not close on command-W
  • Next by Date: Re: NSPanel should not close on command-W
  • Previous by thread: Re: NSPanel should not close on command-W
  • Next by thread: Re: NSPanel should not close on command-W
  • Index(es):
    • Date
    • Thread