• 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
Modal-loop Event-handling question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modal-loop Event-handling question


  • Subject: Modal-loop Event-handling question
  • From: Motti Shneor <email@hidden>
  • Date: Mon, 30 Apr 2012 11:24:57 +0300

Hi all.

In our client-server app we sometimes present modal sheets on our main window. Following server notifications we sometimes have to dismiss these sheets (user is expelled, or otherwise status-changed).

We do this using the [mainWindow attachedSheet] endSheet];

However, If we do this while the user holds one of the sheet buttons pressed --- within the mouse-tracking loop --- than endSheet happens, and then the mouseUp event reaches a released object (the sheet) which then crashes the application.

All this happens in the main thread of the application, and it seems that the modal-event-loop of the sheet does not block network-born events. We have plenty of different sheets, so I prefer not to tailor each one, but rather have a general fix.

Is there a "right way" to go about this? somehow clear the event queue, or close the mouse-tracking loop when I need to end the sheet programmatically? somehow handle the mouse-up in an appropriate way? maybe my whole approach is wrong here?

Any insight will be appreciated --- Thanks.

Motti Shneor
Spectrum Reflections Ltd.
---
Ceterum censeo Microsoftinem delendam esse



_______________________________________________

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

  • Prev by Date: Re: Tracking down SIGABRTs
  • Next by Date: Re: NSTableView doesn't show data until I click on a header
  • Previous by thread: Re: Tracking down SIGABRTs
  • Next by thread: Converting CGPathAddArcToPoint (or NSBezierPath equivalent) to a fixed number of CGPathAddCurveToPoint calls
  • Index(es):
    • Date
    • Thread