• 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: determining front most document?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: determining front most document?


  • Subject: Re: determining front most document?
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 26 Apr 2005 09:54:02 -0700


On Apr 25, 2005, at 11:29 PM, Mark Dawson wrote:

When I bring my preferences window forward, it puts my document behind (as expected). However, I want my pref window to access the "current" document, which I guess is defined as the top most window that has a document associated with it. [[NSDocumentController sharedDocumentController] currentDocument] doesn't work because it returns the document associated with the main window, which is my preference window (so returns nil).

Your preference "window" should not be main. It may become key, but not main -- I would guess that you've used an NSWindow instead of an NSPanel.

See NSWindow 'canBecomeMainWindow' and <http://developer.apple.com/ documentation/Cocoa/Conceptual/WinPanel/Concepts/ ChangingMainKeyWindow.html>

Once you fix this, [[NSDocumentController sharedDocumentController] currentDocument] should work correctly.

mmalc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >determining front most document? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: Address Book-like Window Menu
  • Next by Date: A Question about [[self superview] doSomething]
  • Previous by thread: Re: determining front most document?
  • Next by thread: System Idle Time ... again ...
  • Index(es):
    • Date
    • Thread