kba / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

ProgressBar don't change when setted from other thread #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

ProgressBar don't change when setted from other thread.

I have a thread which make a long processing and I would like to change 
progress value like this :

textGUI.runInEventThread(new Action() {
      @Override
      public void doAction() {
         progressBar.setProgress(step / steps);
         label.setText(step + "/" + steps);
      }
   }
});

The label work but the progress bar don't change before that the thread 
finished.

(I see that there is no invalidate in ProgressBar class. Perhaps this ?)

Thanks a lot,

Original issue reported on code.google.com by pinon.pi...@gmail.com on 19 Jan 2013 at 5:08

GoogleCodeExporter commented 9 years ago
Yes, that's exactly what the problem is, thank you! I'm fixing it now on 2.1.x 
and default branch.

Martin

Original comment by mab...@gmail.com on 20 Jan 2013 at 1:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for your quick help but the problem wasn't fixed.

It's always the same problem.

In fact, before fixing : We need to press Key to refresh bar.
Now progress bar refresh alone at the end of the thread but no during the 
thread run.

Thanks for your good library !

Original comment by pinon.pi...@gmail.com on 20 Jan 2013 at 2:48

GoogleCodeExporter commented 9 years ago
Ignore my previous comment.
It works perfectly !

Thank you again for your help.

Good job !

Original comment by pinon.pi...@gmail.com on 20 Jan 2013 at 3:24

GoogleCodeExporter commented 9 years ago
Oh, ok, good to hear it's working! I actually didn't test it, just assumed it 
was the missing invalidate() call that was causing it...

Original comment by mab...@gmail.com on 21 Jan 2013 at 12:17