Re: How to do a progress window the "right way"?
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: Sun, 26 Sep 2004 10:07:20 +0200
Thank you all for your advice!
I found (almost by accident) an interesting and elegant way of handling
this:
- before calling MovieExportToFile, I call
"beginModalSession:forWindow:" with my progress window as the argument
- in the MovieExport callback, I call "runModalSession:" (with the
session ID supplied above)
- after MovieExportToFile, I call "endModalSession"
That way, the user sees a progress dialog and is able to cancel the
export, but it does not introduce the complexity of handling a second
thread with all the risks of starting multiple exports at once.
I'm sure this is an obvious solution to many of you, but I'm just a
beginner in Cocoa, so I didn't think of that before...
In any case, thanks again for your help!
On 25 sept. 04, at 23:21, Chris Hanson wrote:
On Sep 25, 2004, at 5:27 AM, Nicko van Someren wrote:
Just because something is not thread safe does not mean you can not
run it in a separate thread. The issue with thread safety is to do
with things being accessed from more than one thread. As long as all
the communication with the Movie Expoer component always happens from
the same single thread you should be OK.
Unless it's documented that the Movie Export Component can be called
safely from a non-main thread, you cannot assume the above. Just
because all communication with the Movie Export Component occurs in a
single non-main thread within your code doesn't mean that what you're
doing is safe. There may be other things interacting with the
component that you don't know about.
Or the component may not be thread-safe because it relies on some
underlying subsystem that isn't thread-safe, which may wind up being
invoked from more than one thread if you try to do the above.
Unless it's documented, you can't know, and you should only use it
from the main thread.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
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