• 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: Main but not Key window behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Main but not Key window behavior


  • Subject: Re: Main but not Key window behavior
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 6 Nov 2010 20:48:52 +0000

On 6 Nov 2010, at 18:26, John Pannell wrote:

> Hi all-
>
> I would like to present a utility panel in my application that becomes the key window, but not the main window.  I would like the main window to maintain its active appearance, as is documented in the NSWindow docs, specifically:
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/WinPanel/Concepts/ChangingMainKeyWindow.html#//apple_ref/doc/uid/20000236-BCIDFJFH
>
> My desired appearance is presented in the docs as the primary reason for the key/main distinction.
>
> It seems like it should be quite easy to accomplish this, but my best efforts have come up short - making the utility panel "key" results in greyed-out close/min/zoom widgets on the "main" window.  I've whipped up a demo app to show the effect: my panel is "utility" and "non-activating" in IB, and I launch it with a button to trigger a makeKeyAndOrderFront:.
>
> http://www.positivespinmedia.com/dev/KeyVsMain.zip
>
> I've verified that the windows are in the desired state...
> 2010-11-06 12:22:21.786 KeyVsMain[10930:a0f] app window is key: NO
> 2010-11-06 12:22:21.788 KeyVsMain[10930:a0f] app window is main: YES
> 2010-11-06 12:22:21.789 KeyVsMain[10930:a0f] panel is key: YES
> 2010-11-06 12:22:21.789 KeyVsMain[10930:a0f] panel is main: NO
>
> I'm on 10.6, could anyone verify that they are seeing the same, or better yet, see what I've done wrong to prevent the desired result?
>
> Any help is appreciated!
>
> John
>
I can confirm the behaviour you describe on 10.6.

The docs pointed to say:

For example, when a person is using an inspector, a Find dialog, or the Fonts or Colors windows, the document is the main window and the other window is the key window.

and

So that users can pick out the main window when it’s not the key window, the Application Kit highlights its title bar and colors the window buttons. If the main window is also the key window, it has only the highlighting of the key window.

Try this with text edit and it doesn't pan out like that either. The Find/Font/Color key window is highlighted / coloured and the 'main' window is greyed out.
IB is the same.

Perhaps the docs are showing their age on this (either that or I am).

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com

_______________________________________________

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: 
 >Main but not Key window behavior (From: John Pannell <email@hidden>)

  • Prev by Date: Re: Main but not Key window behavior
  • Next by Date: Re: Custom NSSavePanel
  • Previous by thread: Re: Main but not Key window behavior
  • Next by thread: Over-released NSMenuItem on using "Open Recent" via Help menu search
  • Index(es):
    • Date
    • Thread