• 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: want to keep a main window still, not close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: want to keep a main window still, not close


  • Subject: Re: want to keep a main window still, not close
  • From: Robert Napier <email@hidden>
  • Date: Wed, 9 Apr 2008 09:29:51 -0400

If you really mean main window in the NSWindow sense (makeMainWindow), then you will want to look at the windowShouldClose delegate method (as mentioned by Jack) and observe the NSWindowDidResignMainNotification notification for the window so you can set it back.

More likely, though, you should be looking at NSPanel for your other windows. If they're stealing mainWindow status, NSPanel will fix that because it will refuse to become main. If NSPanel does not meet you need, you can make your own subclass of NSWindow or NSPanel to get what you're looking for.

-Rob

--
Rob Napier -- Software and Security Consulting -- http://robnapier.net



On Apr 8, 2008, at 5:31 PM, norio wrote:
Hi,
My app is not a document-based application. And it has a main window and other windows.


What I want to ask you to tell me is how to remain still the main window even if user
option-clicks the close box of one of the other windows.


I tried observing with its name nil and object nil. But I couldn't get which notification
actually makes the windows close.


Would you tell me how to remain the main window? Of course, it must close if user clicks
the close box of the window.


Any suggestions would be appreciated.

Norio

_______________________________________________

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


References: 
 >want to keep a main window still, not close (From: norio <email@hidden>)

  • Prev by Date: Re: More NSUndoManager woes
  • Next by Date: Re: How to force NSTableView to stop editing a text cell?
  • Previous by thread: Re: want to keep a main window still, not close
  • Next by thread: Core Data for managing subtree?
  • Index(es):
    • Date
    • Thread