• 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: Another Cocoa Bug!! :<
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Cocoa Bug!! :<


  • Subject: Re: Another Cocoa Bug!! :<
  • From: Rosyna <email@hidden>
  • Date: Tue, 28 Aug 2001 21:07:52 -0700

This isn't a bug, NSStatusItems are _not_ menus. You are going to have to check to see if there is less than x amount of windows in NSApp.

And you shouldn't be using NSStatusItem API's as it may change in the future.

Ack, at 8/28/01, Steve Gehrman said:

Everytime I add a new feature to my, I spend hours trying to fix the side effects caused by Cocoa bugs.... ARRRGGGGG!!

Here's another one....

I'm adding an NSStatusBar to the menu bar with the following code

NSStatusBar *statusBar = [NSStatusBar systemStatusBar];

_statusItem = [[statusBar statusItemWithLength:NSVariableStatusItemLength] retain];
[_statusItem setTitle:@"menu"];
[_statusItem setMenu:[[[NSMenu alloc] init] autorelease]];

[self rebuildMenu];

This works great. But it has an annoying side effect. In my app delegate I implement applicationShouldHandleReopen. When the NSStatusBar is set, the flag sent to this routine is true (which means that there are visible windows) even when there are no visible windows. When I turn off the NSStatusBar, this works normally.

- (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag;
{
if (!flag)
[[FileWindowController alloc] init];

return NO;
}

Is this fixed in 10.1?

--
Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insane People


  • Follow-Ups:
    • Re: Another Cocoa Bug!! :<
      • From: Enigmarelle Development <email@hidden>
References: 
 >Another Cocoa Bug!! :< (From: Steve Gehrman <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Bad error?
  • Previous by thread: Another Cocoa Bug!! :<
  • Next by thread: Re: Another Cocoa Bug!! :<
  • Index(es):
    • Date
    • Thread