Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet98.d @ 112:9f4c18c268b2
Update to compile and execute with dmd 2.052.
author | kntroh |
---|---|
date | Wed, 16 Mar 2011 21:53:53 +0900 |
parents | 69b1fa94a4a8 |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
111:b6e9904989ed | 112:9f4c18c268b2 |
---|---|
30 import org.eclipse.swt.widgets.Table; | 30 import org.eclipse.swt.widgets.Table; |
31 import org.eclipse.swt.widgets.TableItem; | 31 import org.eclipse.swt.widgets.TableItem; |
32 | 32 |
33 import java.lang.all; | 33 import java.lang.all; |
34 | 34 |
35 import tango.util.Convert; | 35 version(Tango){ |
36 import tango.util.Convert; | |
37 } else { // Phobos | |
38 import std.conv; | |
39 } | |
36 | 40 |
37 static int pageNum = 0; | 41 static int pageNum = 0; |
38 static Composite pageComposite; | 42 static Composite pageComposite; |
39 | 43 |
40 void main(String args[]) { | 44 void main(String args[]) { |
41 Display display = new Display(); | 45 Display display = new Display(); |
42 final Shell shell = new Shell(display); | 46 Shell shell = new Shell(display); |
43 shell.setLayout(new GridLayout()); | 47 shell.setLayout(new GridLayout()); |
44 Button button = new Button(shell, SWT.PUSH); | 48 Button button = new Button(shell, SWT.PUSH); |
45 button.setText("Push"); | 49 button.setText("Push"); |
46 pageComposite = new Composite(shell, SWT.NONE); | 50 pageComposite = new Composite(shell, SWT.NONE); |
47 pageComposite.setLayout(new GridLayout()); | 51 pageComposite.setLayout(new GridLayout()); |
57 pageComposite.setLayoutData(new GridData()); | 61 pageComposite.setLayoutData(new GridData()); |
58 if (pageNum++ % 2 == 0) { | 62 if (pageNum++ % 2 == 0) { |
59 Table table = new Table(pageComposite, SWT.BORDER); | 63 Table table = new Table(pageComposite, SWT.BORDER); |
60 table.setLayoutData(new GridData()); | 64 table.setLayoutData(new GridData()); |
61 for (int i = 0; i < 5; i++) { | 65 for (int i = 0; i < 5; i++) { |
62 (new TableItem(table, SWT.NONE)).setText("table item " ~ to!(char[])(i)); | 66 (new TableItem(table, SWT.NONE)).setText("table item " ~ to!(String)(i)); |
63 } | 67 } |
64 } else { | 68 } else { |
65 (new Button(pageComposite, SWT.RADIO)).setText("radio"); | 69 (new Button(pageComposite, SWT.RADIO)).setText("radio"); |
66 } | 70 } |
67 shell.layout(true); | 71 shell.layout(true); |