• 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: Making a window topmost within an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a window topmost within an application


  • Subject: Re: Making a window topmost within an application
  • From: Kyle Sluder <email@hidden>
  • Date: Thu, 6 Jan 2011 09:13:01 -0800

On Wed, Jan 5, 2011 at 11:15 PM, deovrat singh <email@hidden> wrote:
> If I put NSNormalWindowLevel , then on clicking any other window of my
> application this window goes in background.While if I use any other level
> than NSNormalWindowLevel , then the window remains topmost even if I switch
> to some other application. I want the window to be topmost only when my
> application is active.How to do this in cocoa ?

There is no way to do this. All windows in the system interact with
each other in the same way, regardless of the app that spawned them.
All windows at the same level can be raised or lowered relative to all
the other windows in that level. By default, the system will raise all
of an app's windows above all other apps' when switching to that app
as a result of Cmd-Tab. But you cannot create a window that is topmost
when your app is active and not topmost when it is not active.

Well, you might be able to do it by using an NSPanel and calling
-setIsFloatingPanel: (or just use a regular window and call
-setLevel:) in response to notifications that your app has become
foremost/resigned foremost status. But there's no way to do this out
of the box because it's not how windows are supposed to work in Mac OS
X.

--Kyle Sluder

>
> Thanks
> --
> Deovrat Singh
> _______________________________________________
>
> 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
>
_______________________________________________

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: 
 >Making a window topmost within an application (From: deovrat singh <email@hidden>)

  • Prev by Date: Re: Event to trigger writeSelectionToPasteboard
  • Next by Date: Re: Execute a pre-starting script first, when the App bundle is launched, then the main executable
  • Previous by thread: Re: Making a window topmost within an application
  • Next by thread: Execute a pre-starting script first, when the App bundle is launched, then the main executable
  • Index(es):
    • Date
    • Thread