• 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: How do I cancel beginSheet: before the next run loop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I cancel beginSheet: before the next run loop?


  • Subject: Re: How do I cancel beginSheet: before the next run loop?
  • From: email@hidden
  • Date: Fri, 15 Mar 2002 18:04:44 -0800

While performing a lengthy operation, I display a sheet with a progress
bar and a cancel button. How would I receive a click in the Cancel
button while I'm monopolising the run loop? I thought I could tell the
currentRunLoop to periodically check for queued events, but that hasn't
been successful. I also don't want any views other than the sheet's
progress bar to update until the operation is done. (That's what
happened when I tried advancing the run loop manually.)

It sounds to me like you want to be doing your "lengthy operation" in a background thread which is cancellable from the main thread if the user hits the Cancel button. If that sounds like a good idea to you, you should check the archives for information on doing this; it is a very frequently discussed topic, so there are reams and reams of ideas, example code, etc.

Ben Haller
Stick Software
_______________________________________________
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.

  • Prev by Date: SOLVED: Workaround to force painting of NSSplitView's
  • Next by Date: Re: mouse drag feedback
  • Previous by thread: How do I cancel beginSheet: before the next run loop?
  • Next by thread: Passing object graphs bycopy (was: DO, bycopy)
  • Index(es):
    • Date
    • Thread