SWT UI-threading issue [message #26208] |
Sat, 21 September 2002 01:12 |
Eclipse User |
|
|
|
Originally posted by: pschork.teleias.com
Hi, I'm new SWT and GUI programming so forgive me if this should be
obvious. I've read through the SWT Threading issue doc but I'm still having
problems allowing my worker thread to communicate with my Shell.
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
sv/doc/guide/swt_threading.htm
I've got a simple shell application that spawns a worker thread (inner
class) . I want the worker thread to update the progress bar on the shell as
it goes. I've tried calling Display.getCurrent().asyncExec( ) from the
worker thread to update the progress bar but my worker thread can not
access the Display (UI-thread I guess). Any advice or example code would be
great.
Thanks,
Patrick
|
|
|
Re: SWT UI-threading issue [message #28308 is a reply to message #26208] |
Sun, 29 September 2002 16:47 |
Eclipse User |
|
|
|
Originally posted by: tmaeder0906.rogers.com
Patrick,
what you want is not the display of the worker thread, but of the UI
thread. So you'll have to pass the display of the UI thread somehow (in
the constructor, for example) to the worker thread.
By the way, you're much more likely to get answers for questions like
this in the eclipse.tools newsgroup
Thomas
PSchork wrote:
> Hi, I'm new SWT and GUI programming so forgive me if this should be
> obvious. I've read through the SWT Threading issue doc but I'm still having
> problems allowing my worker thread to communicate with my Shell.
>
> http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> sv/doc/guide/swt_threading.htm
>
> I've got a simple shell application that spawns a worker thread (inner
> class) . I want the worker thread to update the progress bar on the shell as
> it goes. I've tried calling Display.getCurrent().asyncExec( ) from the
> worker thread to update the progress bar but my worker thread can not
> access the Display (UI-thread I guess). Any advice or example code would be
> great.
> Thanks,
>
> Patrick
>
>
|
|
|
Re: SWT UI-threading issue [message #583712 is a reply to message #26208] |
Sun, 29 September 2002 16:47 |
Eclipse User |
|
|
|
Originally posted by: tmaeder0906.rogers.com
Patrick,
what you want is not the display of the worker thread, but of the UI
thread. So you'll have to pass the display of the UI thread somehow (in
the constructor, for example) to the worker thread.
By the way, you're much more likely to get answers for questions like
this in the eclipse.tools newsgroup
Thomas
PSchork wrote:
> Hi, I'm new SWT and GUI programming so forgive me if this should be
> obvious. I've read through the SWT Threading issue doc but I'm still having
> problems allowing my worker thread to communicate with my Shell.
>
> http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> sv/doc/guide/swt_threading.htm
>
> I've got a simple shell application that spawns a worker thread (inner
> class) . I want the worker thread to update the progress bar on the shell as
> it goes. I've tried calling Display.getCurrent().asyncExec( ) from the
> worker thread to update the progress bar but my worker thread can not
> access the Display (UI-thread I guess). Any advice or example code would be
> great.
> Thanks,
>
> Patrick
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04257 seconds