Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] in a sub thread, how to call a widget of its father

No need to use event and listener.
Use Display#syncExec() or Display#asyncExec() instead, which will make UI Thread execute a piece of code.
For example:
Display display = ....;
display.syncExec( new Runnable() {
   public void run() {
      label.setText("abc");
   }
});



tinawang wrote:

Hi
So, may I use event and listener to inform the UI Thread to modify its widget such as Label.
  If it can, could you please provide a slip of code !
Regard
-Tina


Cheng Mo wrote:

In SWT only UI Thread can access widgets and only one UI Thread.
That is the rule of SWT.
Perhaps this is because swt is designed for Eclipse.





tinawang wrote:

Hi all
I know in Swing I can call a widget such as label from sub thread, but in Swt I can not do this.
    why not, anyone can help me!
Regards,
-Tina

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev





_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev





Back to the top