Re: about Panels and windows
Re: about Panels and windows
- Subject: Re: about Panels and windows
- From: Jeremy Dronfield <email@hidden>
- Date: Fri, 26 Jul 2002 18:16:55 +0100
On Friday, July 26, 2002, at 09:48 am, Cristian Savu wrote:
1. I want to always have the panels floating over the main window
(never to
be send behind it)
2. I want the panels to float ONLY over the main window (not over
another
applications windows)
It's not quite clear what you want. Are you referring to their floating
status when another application becomes active? If so, do something like
the following in your app delegate (or in some other class that's
registered itself to observe the relevant notifications):
- (void)applicationWillResignActive:(NSNotification *)aNotification
{
int index;
for (index = 0; index < [[NSApp windows] count]; index++) {
[[[NSApp windows] objectAtIndex:index] setFloatingPanel:NO];
}
}
- (void)applicationDidBecomeActive:(NSNotification *)aNotification
{
int index;
for (index = 0; index < [[NSApp windows] count]; index++) {
[[[NSApp windows] objectAtIndex:index] setFloatingPanel:YES];
}
}
I haven't actually tested this with NSPanels; I've done it with
-setLevel: on NSWindows. It should leave your mainWindow alone. I'll be
interested to know if it works.
- Jeremy.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.