GroovySWT is
| Excerpt |
|---|
a wrapper around SWT, the eclipse Standard Widget Toolkit |
Here is some SWT code using native Groovy:
| Code Block |
|---|
import org.eclipse.swt.SWT
import org.eclipse.swt.widgets.*
import org.eclipse.swt.layout.RowLayout as Layout
def display = new Display()
def shell = new Shell(display)
shell.layout = new Layout(SWT.VERTICAL)
shell.text = 'Groovy / SWT Test'
def label = new Label(shell, SWT.NONE)
label.text = 'Simple demo of Groovy and SWT'
shell.defaultButton = new Button(shell, SWT.PUSH)
shell.defaultButton.text = ' Push Me '
shell.pack()
shell.open()
while (!shell.disposed) {
if (!shell.display.readAndDispatch()) shell.display.sleep()
}
|
...
- groovy-swt-0.5 with all eclipse libraries and the windows version of SWT: http://docssvn.groovy.codehaus.org/download/attachments/17022/groovy-swt-browse/~raw,r=16909/groovy/trunk/groovy/modules/groovy-swt/dist/groovy-swt-0.5-windows-all.jargroovy-swt-0.5-windows-all.jar
- groovy-swt-0.5 with all eclipse libraries but no SWT: groovy-swt-0.5-without-swt.jar
...