• 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
Background app, NSStatusItem, tight loop, event handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Background app, NSStatusItem, tight loop, event handling
      • From: Andreas Mayer <email@hidden>
    • Re: Background app, NSStatusItem, tight loop, event handling
      • From: Dave Camp <email@hidden>
  • Prev by Date: Re: No Subject
  • Next by Date: Re: Unwanted retain
  • Previous by thread: AddObect to NSTableView
  • Next by thread: Re: Background app, NSStatusItem, tight loop, event handling
  • Index(es):
    • Date
    • Thread