Re: Another Cocoa Bug!! :<
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