Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Simple threading problem
Simple threading problem [message #462112] Thu, 06 October 2005 17:06 Go to next message
Eclipse UserFriend
Originally posted by: dre.doctor.com

hi,

I have a button, which when pressed I'd like to have
i) do some hard work displaying error messages as appropriate
ii) update the gui when complete

My approach has been to do both (i) and (ii) in the same non-GUI thread
(forked from the GUI thread), and then wrap every error message and gui
update with a Display.syncExec

this doesn't make for very readable code though so I was wondering if
there is another way to do this?

thanks,
dr dre
Re: Simple threading problem [message #462114 is a reply to message #462112] Thu, 06 October 2005 17:35 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You can create a method which takes a message as a parm on your class.
Then that method would wrap it in a runnable and do the syncExec. That
way you code would have a simple "displayMsg(message)" call in it
wherever it needs to display the msg.

dr dre wrote:
> hi,
>
> I have a button, which when pressed I'd like to have
> i) do some hard work displaying error messages as appropriate
> ii) update the gui when complete
>
> My approach has been to do both (i) and (ii) in the same non-GUI thread
> (forked from the GUI thread), and then wrap every error message and gui
> update with a Display.syncExec
>
> this doesn't make for very readable code though so I was wondering if
> there is another way to do this?
>
> thanks,
> dr dre
>

--
Thanks,
Rich Kulp
Previous Topic:ImageRegistry and ApplicationWindow
Next Topic:Autoscroll in org.eclipse.swt.browser.Browser
Goto Forum:
  


Current Time: Wed Sep 30 07:04:36 GMT 2020

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

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

Back to the top