Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet214.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 |
---|---|
35 import org.eclipse.swt.widgets.Shell; | 35 import org.eclipse.swt.widgets.Shell; |
36 import org.eclipse.swt.layout.RowLayout; | 36 import org.eclipse.swt.layout.RowLayout; |
37 | 37 |
38 import java.lang.all; | 38 import java.lang.all; |
39 | 39 |
40 import tango.util.Convert; | 40 version(Tango){ |
41 import tango.util.Convert; | |
42 } else { // Phobos | |
43 import std.conv; | |
44 } | |
41 | 45 |
42 static Image oldImage; | 46 static Image oldImage; |
43 void main(String [] args) { | 47 void main(String [] args) { |
44 Display display = new Display (); | 48 Display display = new Display (); |
45 Shell shell = new Shell (display); | 49 Shell shell = new Shell (display); |
52 RowLayout layout2 = new RowLayout (SWT.VERTICAL); | 56 RowLayout layout2 = new RowLayout (SWT.VERTICAL); |
53 layout2.marginWidth = layout2.marginHeight = layout2.spacing = 10; | 57 layout2.marginWidth = layout2.marginHeight = layout2.spacing = 10; |
54 group.setLayout (layout2); | 58 group.setLayout (layout2); |
55 for (int i=0; i<8; i++) { | 59 for (int i=0; i<8; i++) { |
56 Button button = new Button (group, SWT.RADIO); | 60 Button button = new Button (group, SWT.RADIO); |
57 button.setText ("Button " ~ to!(char[])(i)); | 61 button.setText ("Button " ~ to!(String)(i)); |
58 } | 62 } |
59 shell.addListener (SWT.Resize, new class() Listener { | 63 shell.addListener (SWT.Resize, new class() Listener { |
60 public void handleEvent (Event event) { | 64 public void handleEvent (Event event) { |
61 Rectangle rect = shell.getClientArea (); | 65 Rectangle rect = shell.getClientArea (); |
62 Image newImage = new Image (display, Math.max (1, rect.width), 1); | 66 Image newImage = new Image (display, Math.max (1, rect.width), 1); |