Simple threading problem [message #462112] |
Thu, 06 October 2005 17:06 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02719 seconds