Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet247.d @ 29:4e5843b771cc
First snippets buildable on windows
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 22 Mar 2009 19:55:00 +0100 |
parents | 69b1fa94a4a8 |
children | 9f4c18c268b2 |
comparison
equal
deleted
inserted
replaced
28:69b1fa94a4a8 | 29:4e5843b771cc |
---|---|
36 | 36 |
37 void main (String [] args) { | 37 void main (String [] args) { |
38 Display display = new Display (); | 38 Display display = new Display (); |
39 Shell shell = new Shell (display); | 39 Shell shell = new Shell (display); |
40 shell.setLayout(new RowLayout()); | 40 shell.setLayout(new RowLayout()); |
41 Text text = new Text(shell, SWT.MULTI | DWT.BORDER); | 41 Text text = new Text(shell, SWT.MULTI | SWT.BORDER); |
42 String modifier = SWT.MOD1 == DWT.CTRL ? "Ctrl" : "Command"; | 42 String modifier = SWT.MOD1 == SWT.CTRL ? "Ctrl" : "Command"; |
43 text.setText("Hit " ~ modifier ~ "+Return\nto see\nthe default button\nrun"); | 43 text.setText("Hit " ~ modifier ~ "+Return\nto see\nthe default button\nrun"); |
44 text.addTraverseListener(new class() TraverseListener{ | 44 text.addTraverseListener(new class() TraverseListener{ |
45 public void keyTraversed(TraverseEvent e) { | 45 public void keyTraversed(TraverseEvent e) { |
46 switch (e.detail) { | 46 switch (e.detail) { |
47 case SWT.TRAVERSE_RETURN: | 47 case SWT.TRAVERSE_RETURN: |