Call XWT.findElementByName Method in User-Interface Thread [message #522218] |
Sun, 21 March 2010 12:57 |
can kayacan Messages: 16 Registered: March 2010 |
Junior Member |
|
|
Hi,
My XWT UI Element implements the java.util.Observer class.
in the update method of the Observer class, I want to get the canvas element by calling XWT.findElementByName but it always returns null.
@Override
public void update(Observable o, Object arg) {
this.getDisplay().asyncExec(new Runnable() {
public void run() {
Canvas pitchCanvas = (Canvas) XWT.findElementByName(this, "PitchCanvas"); // RETURNS NULL
}
});
But if I call the same in the paint events it works:
public void onPaintEvent(Object object, Event event) {
Canvas pitchCanvas = (Canvas) XWT.findElementByName(this, "PitchCanvas"); // WORKS
XWT has problems to be invoked within the user-interface thread?
Is it a bug?
[Updated on: Sun, 21 March 2010 12:59] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04029 seconds