On 21 Jul 2014, at 15:20, John leger <
johnl...@gmail.com> wrote:
> So i didn't know that but when I was doing my computations, the interface was freezing so that's why I use a thread (because the computation was not done in "execute" either).
> My computations are called when we move the slider, so they need to be done on the fly (and after "execute()") as "execute()" is called only once.
That is the reason why the interface is freezing. The run button calls “execute” in a separate thread, but a change listener method (from slider events) will run on the graphical thread.
> I already thought of adding my own "EmergencyStopButton" but if i could use the standard one it would have been better, but no problems I will try this idea
I do have a method (currently hidden) called via “getUI().setRunningState(boolean)” that handles the states of both the run and stop buttons (it’s the one I use internally when the run button is clicked by the user). I could give you public access to that (once I make sure it doesn’t break anything else…), so you can set it to true (again) after each change value on your slider, and set it back to false after your computations are done. Does this seem reasonable?
Alexandre