Community
Participate
Working Groups
Here is a small program which creates a window with a button and then spins forever asking for the available types. When run, you can still click on the button, even though we never run the event loop. Regarding bug 44915, it seems that implementing a synchronous clipboard retrieval under X is challenging. import org.eclipse.swt.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; import org.eclipse.swt.dnd.*; public class main { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Event loopy?"); shell.setLayout(new FillLayout()); Button b = new Button(shell, SWT.PUSH); b.setText("yum yum"); Clipboard c = new Clipboard(display); shell.open(); int foo = 1; while(foo > 0) { c.getAvailableTypes(); System.out.println("i eat cheese"); try { Thread.sleep(500); } catch( Exception e) { } } while( !shell.isDisposed() ) { if( !display.readAndDispatch()) display.sleep(); } display.dispose(); } }
Not any more. New implementation of Clipboard has our own control over event loop.