On Wed, Jan 5, 2011 at 11:15 PM, deovrat singh <devspeedocr...@gmail.com> 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 (Cocoa-dev@lists.apple.com) > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/kyle.sluder%40gmail.com > > This email sent to kyle.slu...@gmail.com > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com