Re: App menubar dead SOLVED
Re: App menubar dead SOLVED
- Subject: Re: App menubar dead SOLVED
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 26 Oct 2006 06:32:19 -0400
- Thread-topic: App menubar dead SOLVED
on 2006-10-25 6:15 PM, Bill Cheeseman at email@hidden wrote:
> I hide my app programmatically. But when it unhides, its menubar is
> unresponsive. Any ideas on how to avoid this problem?
For the archives:
This appears to be a longtime bug in Cocoa. The issue was raised, confirmed
by another developer, but not solved back in 2002,
here:<http://www.cocoabuilder.com/archive/message/cocoa/2002/8/16/60669>
I have found a workaround. I set my utility window's controller to be my app
delegate temporarily, and implement the -[NSApplication
applicationWillUnhide:] delegate method like this:
- (void)applicationWillUnhide:(NSNotification *)notification {
// Delegate method per NSApplication. Needed here to work around Mac OS
X bug where clicking in unhidable app window while app is hidden fails to
show app menu bar unless another app is activated first.
[[NSWorkspace sharedWorkspace] launchApplication:[[[[NSWorkspace
sharedWorkspace] launchedApplications] objectAtIndex:0]
objectForKey:@"NSApplicationPath"]]; // oldest running app
[NSApp activateIgnoringOtherApps:YES];
[[[self browserController] window] makeKeyAndOrderFront:nil];
}
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden