Re: Continue application processing with mouse down on a menu
Re: Continue application processing with mouse down on a menu
- Subject: Re: Continue application processing with mouse down on a menu
- From: Eric Schlegel <email@hidden>
- Date: Sat, 26 Sep 2015 10:03:20 -0700
> On Sep 26, 2015, at 9:51 AM, Jens Alfke <email@hidden> wrote:
>
>
>> On Sep 26, 2015, at 7:11 AM, Programmingkid <email@hidden> wrote:
>>
>> It has seem like a rule that has been in place forever that an application pauses processing when the mouse is down on a menu. Is there a way to make the application continue processing even with the mouse down?
>
> No, that was only true in the old "classic" OS. In OS X, menu tracking runs in a different thread and doesn't block the app's thread(s).
No, that’s not true. Menu tracking runs on the main thread and does block other event handling on the main thread for the app that owns the menus. This is exactly the same as any other modal event tracking, such as pushing on a button, which also blocks other event processing on the main thread.
However, there are the usual ways around this:
- an event loop timer (using NSEventTrackingRunLoopMode)
- using a separate thread, dispatch queue, etc.
- using a separate process if necessary
-eric
_______________________________________________
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