Re: NSProgressIndicator, MUST use threads?
Re: NSProgressIndicator, MUST use threads?
- Subject: Re: NSProgressIndicator, MUST use threads?
- From: Matthew <email@hidden>
- Date: Mon, 13 Dec 2004 21:54:12 -0500
Ok, so I was trying way too hard. Originally I had tried this and it
didn't appear to work (last week when I had to reinstantiate my
controller for some reason). The solution is simple, and here it is. In
case I forget between now and next time I have this same question,
maybe I'll find this thread on google ;)
[barberPole setUsesThreadedAnimation:YES];
On Dec 13, 2004, at 9:21 PM, Matthew wrote:
Hello,
I'm working on a toy example using an indeterminate progress
indicator. Once a user clicks on a button, I call a method that should
start the barber pole spinning, do some stuff, and then stop it when
that stuff finishes.
The problem is that it's not spinning at all, not with startAnimation:
or with a loop that repeatedly calls animate: to another progress
indicator.
I notice that as long as the method that was called from the button
press is actively running, that the button retains the focus (and
appears pressed), so does that 'freeze' the view from other things
rendering?
On the other hand, if I start it spinning in awakeFromNib and have the
button press stop the spin, then it stops it fine.
Here's the relevant (and only) portion of code to be concerned with.
It's set to be indeterminate and it does work. For instance, if I have
this method start the spinning, the spinning starts and just keeps
going. That's great except that I want it to spin while the method is
actively running and stop when it finishes.
//this method obviously runs forever, but neither barber pole spins
during that time.
- (IBAction)startSpinning:(id)sender
{
[barberPole startAnimation:nil];
while (TRUE) {
// [barberPole animate:nil];
[barberPole2 animate:nil];
}
}
Is there a way to get this to animate without using threads?
Matthew
_______________________________________________
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
_______________________________________________
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