Re: Problem with updating NSProgressIndicator
Re: Problem with updating NSProgressIndicator
- Subject: Re: Problem with updating NSProgressIndicator
- From: "Shawn Erickson" <email@hidden>
- Date: Tue, 20 May 2008 13:56:00 -0700
On Mon, May 19, 2008 at 11:53 PM, Vitaly Ovchinnikov
<email@hidden> wrote:
> Hello
> I work on Cocoa application that uses posix thread to perform big
> calculations. I need to display the progress. Big caculations are done
> with C++ and I have a callback function that called by the calculating
> thread with the current progress (structure with data). I put this
> structures to the queue (std::vector, guarded by the mutex). This is
> the separate thread.
>
> Now the main thread: I need to check my queue and (among other things)
> update the progress. So I created NSTimer (with period of 0.1 second)
> that checks my queue and (among other things) calls -setDoubleValue
> for NSProgressIndicator. Maybe it looks a bit tricky, but it is just a
> marshalling of structures from one thread to another, it worked fine
> for me in Windows, it is tested etc....
>
> Now the problem: progress indicator freezes. It doesn't even play
> animation! It may move to 30% and freeze there.
If you send your progress view a setUsesThreadedAnimation: message
with a value of YES do it continue to animate?
If it does then you are somehow blocking your main thread.
-Shawn
_______________________________________________
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