• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: App menubar dead SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >App menubar dead (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: NSTimer question: How to fire at second 00, 05, 10 etc ?
  • Next by Date: Re: App menubar dead
  • Previous by thread: Re: App menubar dead
  • Next by thread: Re: App menubar dead
  • Index(es):
    • Date
    • Thread