NSProgressIndicator, MUST use threads?
NSProgressIndicator, MUST use threads?
- Subject: NSProgressIndicator, MUST use threads?
- From: Matthew <email@hidden>
- Date: Mon, 13 Dec 2004 21:21:00 -0500
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:
This email sent to email@hidden