comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet224.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
29 import org.eclipse.swt.widgets.Listener; 29 import org.eclipse.swt.widgets.Listener;
30 import org.eclipse.swt.widgets.Shell; 30 import org.eclipse.swt.widgets.Shell;
31 import org.eclipse.swt.layout.RowLayout; 31 import org.eclipse.swt.layout.RowLayout;
32 32
33 import java.lang.all; 33 import java.lang.all;
34 import tango.util.Convert; 34
35 version(Tango){
36 import tango.util.Convert;
37 } else { // Phobos
38 import std.conv;
39 }
35 40
36 void main(String[] args){ 41 void main(String[] args){
37 Snippet224.main(args); 42 Snippet224.main(args);
38 } 43 }
39 44
43 Display display = new Display (); 48 Display display = new Display ();
44 Shell shell = new Shell (display); 49 Shell shell = new Shell (display);
45 shell.setLayout (new RowLayout (SWT.VERTICAL)); 50 shell.setLayout (new RowLayout (SWT.VERTICAL));
46 for (int i=0; i<8; i++) { 51 for (int i=0; i<8; i++) {
47 Button button = new Button (shell, SWT.RADIO); 52 Button button = new Button (shell, SWT.RADIO);
48 button.setText ("B" ~ to!(char[])(i)); 53 button.setText ("B" ~ to!(String)(i));
49 if (i == 0) button.setSelection (true); 54 if (i == 0) button.setSelection (true);
50 } 55 }
51 Button button = new Button (shell, SWT.PUSH); 56 Button button = new Button (shell, SWT.PUSH);
52 button.setText ("Set Selection to B4"); 57 button.setText ("Set Selection to B4");
53 button.addListener (SWT.Selection, new class() Listener{ 58 button.addListener (SWT.Selection, new class() Listener{