Re: Making a window topmost within an application
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