Re: How to run progress bar in a separate thread

2008-03-11 Thread James Hober
The following runs your progress indicator modally, which means the user can't do anything while it runs. You may or may not want that behavior. It uses a timer to update the progress indicator on the main thread by reading some instance variables. Your secondary thread writes to those

How to run progress bar in a separate thread

2008-03-10 Thread Nick Rogers
Hi, My app has to show a progress bar on the main window. I have an outlet of type NSProgressIndicator. A start button triggers the method in which I'm incrementing the progress bar. But the buttons stop working once the method gets called. How can I run this progress bar in a separate

Re: How to run progress bar in a separate thread

2008-03-10 Thread Jeff LaMarche
On Mar 10, 2008, at 10:08 PM, Nick Rogers wrote: NSThread has one method: + (void)detachNewThreadSelector:(SEL)aSelector toTarget:(id)aTarget withObject:(id)anArgument But its hard to understand as to how to implement it, since its a class method. Don't

Re: How to run progress bar in a separate thread

2008-03-10 Thread Jiva DeVoe
Make sure if you're doing this that you're not actually updating the GUI code from your other thread because much of cocoa is not thread safe. Instead, use the performSelectorOnMainThread... Method to do your update to the progress bar in the main thread. -- Jiva DeVoe