• 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: newbie:how to get the frontmost window but a key window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie:how to get the frontmost window but a key window


  • Subject: Re: newbie:how to get the frontmost window but a key window
  • From: norio <email@hidden>
  • Date: Fri, 11 Jan 2008 19:58:46 +0900

Joar, thanks for your quick response.

What I want to do is to search text from the window just below "Find..." dialog, like almost every text editor do.

My app opens a window which doesn't have text input field at launch time. The window just displays something.

Then open a document by selecting Open... from File menu. So you can open several windows. I thought they were main windows.

And open Find.. window and when you press Find button on the window, text is being searched from the document of the window just below the Find window.

With these steps, currentDocument and mainWindow return nil as I told in the previous mail.
Who sets a window to main window? I went to see the inspector window of the window in IB but I couldn't get.


I wish I could explain more clearly.

Norio Ota

On 2008/01/11, at 14:53, j o a r wrote:

Hi,

What is the problem that you're really trying to solve here? Why do you need to find a window behind the key window that's not the main window? I suspect that we will be able to give you a better answer if we can understand what you're really trying to do.

As an example, your real problem might not be that you need the ability to find a non-main window, but rather that the window you're trying to find *should* be main, but isn't. It's important to identify the correct problem to solve before attempting to find a solution.

j o a r


On Jan 10, 2008, at 8:15 PM, norio wrote:

Hi,

I'd like to know how to get the most front window below a key window (e.g.Find dialog).


I've tried the following things but failed.

1. call currentDocument of the sharedDocumentController and tried to get the window from the document.
But the document returned by currentDocument was nil.


2. call mainWindow of the sharedApplication. But the return object was nil.


Thanks in advance. Norio Ota


_______________________________________________

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: newbie:how to get the frontmost window but a key window
      • From: j o a r <email@hidden>
References: 
 >newbie:how to get the frontmost window but a key window (From: norio <email@hidden>)
 >Re: newbie:how to get the frontmost window but a key window (From: j o a r <email@hidden>)

  • Prev by Date: Saving an NSDocument safely
  • Next by Date: Source list group item indentation
  • Previous by thread: Re: newbie:how to get the frontmost window but a key window
  • Next by thread: Re: newbie:how to get the frontmost window but a key window
  • Index(es):
    • Date
    • Thread