Re: Progress bar on front NSPanel is grey not blue??
Re: Progress bar on front NSPanel is grey not blue??
- Subject: Re: Progress bar on front NSPanel is grey not blue??
- From: Keary Suska <email@hidden>
- Date: Thu, 13 Apr 2006 09:15:30 -0600
on 4/13/06 7:58 AM, email@hidden purportedly said:
> I can't make this as a separate thread. I'm porting code written for
> the PC, and the original just doesn't work that way.
>
> the useThreadedAnimation: trick didn't work unfortunatealy. I am
> doing this:
>
> [p setUsesThreadedAnimation:true];
>
> but it doesn't work! Same greyness.
I wouldn't think so. And for the record, threading is the #1 most overused
and abused techniques and should be the *last* option pursued if no other
solutions work. I doubt they would be recommended as much if Cocoa didn't
make them too easy.
That being said, the issue here may be more about how your panel is being
invoked, and this addresses both of your questions. Instead try something
like:
NSModalSession session = [NSApp beginModalSessionForWindow:progressWin];
// hot loop
for(;;) {
// do your stuff
// update the progress bar
// call this for event processing
result = [NSApp runModalSession:session];
// you could do something with the result if you want
}
// then done
[NSApp endModalSession:session];
[progressWin close];
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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