Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Multi-threaded and org.eclipse.widgets.Display
Multi-threaded and org.eclipse.widgets.Display [message #448181] Wed, 05 January 2005 01:21 Go to next message
Eclipse UserFriend
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 14:59 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
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
>
Previous Topic:How to align verticaly text into a Label ?
Next Topic:Double click event in Combo
Goto Forum:
  


Current Time: Thu Apr 25 08:33:54 GMT 2024

Powered by FUDForum. Page generated in 0.02655 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top