| [news.eclipse.platform.swt] Re: Updating a widget from a background running thread |
|
... final Display display = new Display(); Thread thread = new Thread(new Runnable() { public void run() { ... // thread code goes here display.syncExec(new Runnable() { public void run() { // enter your updating code here } }); ... } }).start(); ... Technically, the code within the syncExec(Runnable) block isn't actually being run inside your other thread, It's being run inside the event dispatch loop (i.e while(!shell.isDisposed()) if (!display.readAndDispatch()) ...) However, this should clear up your problem. It would be best if you can keep just the ui updating code within the syncExec(Runnable) block and do as much as possible outside the block in your Thread. Otherwise your ui will start to bog down. Daniel Xavier wrote: Hello, |