Background app, NSStatusItem, tight loop, event handling
Background app, NSStatusItem, tight loop, event handling
- Subject: Background app, NSStatusItem, tight loop, event handling
- From: Dave Hersey <email@hidden>
- Date: Thu, 05 Feb 2004 12:59:33 -0500
Hi,
I have a background app with an NSStatusItem. When I use the StatusItem to
start some data processing, a number of tight loops are entered and events
to the StatusItem are blocked until the processing completes. Other status
items remain responsive during this time.
Clicking on my menu does nothing until the processing completes, at which
time the menu pops down. Unfortunately, once of the menu items in the status
item is a Cancel option, so I'd really like to be able to click on the thing
and pull down that item before processing completes.
During the processing, I've tried giving back time to my run loop using:
NSDate *dateToStop = [[NSDate alloc] initWithTimeIntervalSinceNow: 1.0f];
[[NSRunLoop currentRunLoop] runUntilDate: dateToStop];
[dateToStop release];
But this doesn't help at all. (I initially tried much smaller values for the
duration, but even at 5 seconds the menu clicks are still blocked.)
Since giving time back to the run loop doesn't help, what's the correct
approach for getting these menu events handled while working in tight loops?
Thanks,
- Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.