Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet115.d @ 44:ed96ea2a2764
First swt win snippets are buiding with d2+phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 25 Mar 2009 18:31:01 +0100 |
parents | 4e5843b771cc |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
43:b98647bc0aef | 44:ed96ea2a2764 |
---|---|
27 import org.eclipse.swt.widgets.Listener; | 27 import org.eclipse.swt.widgets.Listener; |
28 import org.eclipse.swt.widgets.Shell; | 28 import org.eclipse.swt.widgets.Shell; |
29 import org.eclipse.swt.layout.RowLayout; | 29 import org.eclipse.swt.layout.RowLayout; |
30 | 30 |
31 import java.lang.all; | 31 import java.lang.all; |
32 import tango.util.Convert; | |
33 | 32 |
34 void main (String [] args) { | 33 void main (String [] args) { |
35 Display display = new Display (); | 34 Display display = new Display (); |
36 Shell shell = new Shell (display); | 35 Shell shell = new Shell (display); |
37 shell.setLayout (new RowLayout (SWT.VERTICAL)); | 36 shell.setLayout (new RowLayout (SWT.VERTICAL)); |
57 button.setSelection (true); | 56 button.setSelection (true); |
58 } | 57 } |
59 }; | 58 }; |
60 for (int i=0; i<4; i++) { | 59 for (int i=0; i<4; i++) { |
61 Button button = new Button (c1, SWT.RADIO); | 60 Button button = new Button (c1, SWT.RADIO); |
62 button.setText ("Button " ~ to!(char[])(i)); | 61 button.setText (Format("Button {}",i)); |
63 button.addListener (SWT.Selection, radioGroup); | 62 button.addListener (SWT.Selection, radioGroup); |
64 } | 63 } |
65 for (int i=0; i<4; i++) { | 64 for (int i=0; i<4; i++) { |
66 Button button = new Button (c2, SWT.RADIO); | 65 Button button = new Button (c2, SWT.RADIO); |
67 button.setText ("Button " ~to!(char[])(i + 4)); | 66 button.setText (Format("Button {}",(i + 4))); |
68 button.addListener (SWT.Selection, radioGroup); | 67 button.addListener (SWT.Selection, radioGroup); |
69 } | 68 } |
70 shell.pack (); | 69 shell.pack (); |
71 shell.open (); | 70 shell.open (); |
72 while (!shell.isDisposed()) { | 71 while (!shell.isDisposed()) { |