Multi-threaded and org.eclipse.widgets.Display [message #448181] |
Tue, 04 January 2005 20:21  |
Eclipse User |
|
|
|
Originally posted by: al_rody.hotmail.com
I am new with SWT and using multi-threaded on one single Display. I found
that only a thread that create a Display can accessed its own Display
instance by Display.getCurrent(), while the others can't, except use
Display.getDefault(), is that correct?
Because, when i use other thread that does not create Display to do
"draw2d.Figure.setBackgroud()", I got NullPointerException from
org.eclipse.draw2d.DeferredUpdateManager.queueWork() because it uses
Display.getCurrent() to obtain Display instance.
The question is how can I do as Eclipse SWT API said "(To support
multi-threaded user-interface applications, class Display provides
inter-thread communication methods which allow threads other than the
user-interface thread to request that it perform operations on their
behalf.)"
Regards,
rody
|
|
|
Re: Multi-threaded and org.eclipse.widgets.Display [message #448196 is a reply to message #448181] |
Wed, 05 January 2005 09:59  |
Eclipse User |
|
|
|
See Display.syncExec() and Display.asyncExec().
"rody" <al_rody@hotmail.com> wrote in message
news:crffe1$ha7$1@www.eclipse.org...
> I am new with SWT and using multi-threaded on one single Display. I found
> that only a thread that create a Display can accessed its own Display
> instance by Display.getCurrent(), while the others can't, except use
> Display.getDefault(), is that correct?
>
> Because, when i use other thread that does not create Display to do
> "draw2d.Figure.setBackgroud()", I got NullPointerException from
> org.eclipse.draw2d.DeferredUpdateManager.queueWork() because it uses
> Display.getCurrent() to obtain Display instance.
>
> The question is how can I do as Eclipse SWT API said "(To support
> multi-threaded user-interface applications, class Display provides
> inter-thread communication methods which allow threads other than the
> user-interface thread to request that it perform operations on their
> behalf.)"
>
> Regards,
> rody
>
|
|
|
Powered by
FUDForum. Page generated in 0.06305 seconds