Re: Faceless app showing window?
Re: Faceless app showing window?
- Subject: Re: Faceless app showing window?
- From: Wade Tregaskis <email@hidden>
- Date: Sat, 13 Mar 2004 15:50:47 +1100
i have an application which runs in the background and creates a
NSStatusItem in the menu bar, my question is how do i make it display a
window? i've tried
[NSApp activateIgnoringOtherApps:YES];
[adminConsole makeKeyAndOrderFront:nil];
I have an app which does this. It creates the window pragmatically,
using the following code:
window = [[NSWindow alloc] initWithContentRect:windowRect
styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered
defer:NO];
if (window) {
[window setLevel:(NSMainMenuWindowLevel - 1)];
[window setHasShadow:NO];
[window setAlphaValue:0.75];
[window setOpaque:NO];
[window setMovableByWindowBackground:YES];
[window orderFrontRegardless];
}
This [of course] works fine. I believe the trick is that you have to
order the window to front; prior to that it doesn't actually exist on
the screen (even if you ask for it not to be deferred, as I do above).
If you're working with a window from a nib, it should already be setup,
so all you'll need to do is order it to front (i.e it should already
have the default level, so you needn't set that yourself).
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.