• 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 to do a progress window the "right way"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do a progress window the "right way"?


  • Subject: Re: How to do a progress window the "right way"?
  • From: Daniel Tapie <email@hidden>
  • Date: Sat, 25 Sep 2004 14:09:50 +0200

Hi Fred,

Thanks for your tip. It seems it works, even if I have to call "YieldToAnyThread" from a Cocoa timer in order to have the export thread continue running.

What happens is that the first time the export thread calls YieldToAnyThread (to allow the display to update), it looses process time forever until I "force" another YieldToAnyThread from the Cocoa timer.

Maybe we shouldn't be mixing Thread Manager threads with Cocoa?

In any case, it works for now, so thanks for your help!


On 25 sept. 04, at 13:11, Frederick Cheung wrote:


On 25 Sep 2004, at 13:00, Daniel Tapie wrote:

Hi,

I'd like to be able to display a progress window (with a cancel button) for a QuickTime movie export process.

It is apparently a simple challenge, but I'm am running into a few problems:

- the MovieExport component is NOT thread-safe, so I cannot do the export from a separate thread

- the only way to update the display and handle events during the export is through the QT callback mechanism (which works fine and enables me to call Cocoa routines thanks to an autorelease pool I've set up.

- I am able to determine the position of the Cancel button and therefore check if the mouse has been clicked in that rectangle BUT the problem comes when the user moves the Window because the window frame is not updated until the MovieExport process finishes. Since Cocoa does not provide a way to "lock" a window to a specific position, I'm stuck here...


So, because of all these closed doors, I wondered if there was a recommended way to provide feedback to the user and allow the user to cancel these kinds of processes.


Thanks for any pointers you might have,


You could run the export in a separate cooperative thread and give time to your main thread running the progress window etc. by calling YieldToAnyThread from the callback.

Fred





Daniel Tapie


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: How to do a progress window the "right way"?
      • From: Frederick Cheung <email@hidden>
References: 
 >How to do a progress window the "right way"? (From: Daniel Tapie <email@hidden>)
 >Re: How to do a progress window the "right way"? (From: Frederick Cheung <email@hidden>)

  • Prev by Date: Re: Multiple Inheritence (Was: Is _objc_flush_caches_(Class) necessary to swizzle methods?)
  • Next by Date: Re: How to do a progress window the "right way"?
  • Previous by thread: Re: How to do a progress window the "right way"?
  • Next by thread: Re: How to do a progress window the "right way"?
  • Index(es):
    • Date
    • Thread