Re: NSStatusItemthreading
Re: NSStatusItemthreading
- Subject: Re: NSStatusItemthreading
- From: Graham Cox <email@hidden>
- Date: Mon, 26 Jul 2010 10:35:48 +1000
On 26/07/2010, at 4:53 AM, Joe Turner wrote:
> I recently realized that when the user opens the NSStatusItem in my app, the main run loop gets blocked up until they close it. This is a big issue for parts of my app, so I need a way to thread the NSStatusItem. I tried to create it in a new thread, hoping it would then do all of its interactions in a new thread, however this didn't work. So, is there a way to thread the status item so I don't have to thread all of the tasks that might need to happen while the bar is open?
Something to consider is that when any menu is being tracked, the main run loop is using the 'tracking' run loop mode. I could be wrong but I would assume this applies to NSStatusItem menus as well. The main run loop is not blocked, but the different mode can exclude various operations from running, such as timers (by default). Therefore you can probably fix your problem by ensuring that you allow stuff to run normally in this mode. Look up NSRunLoop and NSEventTrackingRunLoopMode to read more about this.
--Graham_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden