• 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
Re: Getting mouse clicks when the main loop is busy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting mouse clicks when the main loop is busy


  • Subject: Re: Getting mouse clicks when the main loop is busy
  • From: Kyle Sluder <email@hidden>
  • Date: Fri, 08 Nov 2013 09:45:36 -0800

> On Nov 8, 2013, at 9:16 AM, Graham Cox <email@hidden> wrote:
>
> Unfortunately, it doesn’t work: the mouse clicks are not received and/or processed (I’m not sure which). The Cancel button is just an ordinary button, and if the dialog is displayed as a window without doing any work, I can click the button as normal.

It’s -[NSApplication run] that is responsible for dispatching events, not NSRunLoop. It sounds like you want to be pumping the event loop yourself. Try using -sendEvent: and -nextEventMatchingMask:untilDate:nil inMode: dequeue:YES.

>
> I’ve also tried running the runloop as above, then immediately trying to handle any events for the window directly (which seems unnecessary, but I tried it anyway). That doesn’t help.

I don't know if this is the same as what I described above. You shouldn’t have to run the runloop yourself; -nextEventMatchingMask: will run it for you.

--Kyle Sluder

_______________________________________________

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


References: 
 >Getting mouse clicks when the main loop is busy (From: Graham Cox <email@hidden>)

  • Prev by Date: Getting mouse clicks when the main loop is busy
  • Next by Date: Re: Getting mouse clicks when the main loop is busy
  • Previous by thread: Getting mouse clicks when the main loop is busy
  • Next by thread: Re: Getting mouse clicks when the main loop is busy
  • Index(es):
    • Date
    • Thread