Re: NSProgressIndicator not animating when part of NSAnimation
Re: NSProgressIndicator not animating when part of NSAnimation
- Subject: Re: NSProgressIndicator not animating when part of NSAnimation
- From: Thomas Bauer <email@hidden>
- Date: Sun, 16 Aug 2009 13:45:00 +1200
Hi!
Thanks for your response.
I am not quite sure if I understand you correctly but here is what I
tried:
- Calling the whole code (starting the NSAnimation and the
ProgressIndicator animation) using a performSelectorOnMainThread does
not fix it.
- Calling the whole code using performSelector delayed does not fix it.
- Calling the NSProgressIndicator startanimation alone on the main
thread does not fix it either.
However your response triggered an idea and this works:
[myViewNSAnimation startAnimation];
[myindicator performSelector:@selector(startAnimation:) withObject:nil
afterDelay:1.1];
Does the trick, but only if the delay is greater than the duration of
the NSAnimation.
In short, if I call the selector (even on the main thread) during the
NSAnimation is running, it does not work.
That would make some sense - but why the same thing works without
those tricks in awakefromnib does not make sense to me...
Because I would think that running it in awakefromnib and running it
using performSelectorOnMainThread should be somewhat identical?
While it is great that I have a workaround ... I would appreciate any
explaination on why it behaves that way.
Technically this does not make sense to me.
Cheers
Thomas
On 16/08/2009, at 1:11 PM, Kyle Sluder wrote:
On Aug 15, 2009, at 6:04 PM, Thomas Bauer <email@hidden>
wrote:
Further to my below question I found out that the problem is
related to what is triggering the code that starts the animation:
If the code that starts the NSAnimation and the NSProgressIndicator
animation is called in an IBAction called by a button on a
different window,
the NSProgressIndicator animation does not start.
Try scheduling a delayed perform in a normal runloop mode. The
button is probably implementing its own runloop (one of the two ways
controls perform mouse tracking). You need to break out of this
runloop mode, and peformSelector:onMainThread: will do it.
--Kyle Sluder
_______________________________________________
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