Another Cocoa Bug!!
Another Cocoa Bug!!
- Subject: Another Cocoa Bug!!
- From: Steve Gehrman <email@hidden>
- Date: Tue, 28 Aug 2001 18:13:18 -0700
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 always 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?
steve