| [news.eclipse.platform.swt] Re: Event Queue? |
Regards Stefan
Hi,
it was my fault getDefault() returns not null. Now I got an "Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access" when I try to add an filter to the Display.
Regards, Mirco
Mirco Dunker schrieb:Hi,
Calling getDisplay() or getCurrent() always returns null.
For example I want to get the events from eclipse. How can I get the Display which belongs to eclipse?
Regards, Mirco
Tom Schindl schrieb:Hi,
you can get it from any widget by calling getDisplay() or by calling Display#getCurrent() which is a static method.
Tom
Mirco Dunker schrieb:Hi,
I don't have much experience in swt, how can i get the current Display? The running Display wasn't created by myself.
Regards, Mirco
Tom Schindl schrieb:Hi,
In SWT you use: Display#addFilter()
Tom
Mirco Dunker schrieb:Hi,
i want to trace some SWT Events. With AWT its really easy to do this:
Toolkit.getDefaultToolkit().getSystemEventQueue().push( new EventQueue() { protected void dispatchEvent(AWTEvent event) { //do something super.dispatchEvent(event); } });
How can i do this for SWT?
Regards, Mirco