Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet76.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 |
comparison
equal
deleted
inserted
replaced
111:b6e9904989ed | 112:9f4c18c268b2 |
---|---|
22 import org.eclipse.swt.widgets.Display; | 22 import org.eclipse.swt.widgets.Display; |
23 import org.eclipse.swt.widgets.Shell; | 23 import org.eclipse.swt.widgets.Shell; |
24 import org.eclipse.swt.widgets.TabFolder; | 24 import org.eclipse.swt.widgets.TabFolder; |
25 import org.eclipse.swt.widgets.TabItem; | 25 import org.eclipse.swt.widgets.TabItem; |
26 import org.eclipse.swt.widgets.Button; | 26 import org.eclipse.swt.widgets.Button; |
27 import java.lang.all; | |
27 | 28 |
28 import tango.util.Convert; | 29 version(Tango){ |
30 import tango.util.Convert; | |
31 } else { // Phobos | |
32 import std.conv; | |
33 } | |
29 | 34 |
30 void main () { | 35 void main () { |
31 Display display = new Display (); | 36 Display display = new Display (); |
32 final Shell shell = new Shell (display); | 37 Shell shell = new Shell (display); |
33 final TabFolder tabFolder = new TabFolder (shell, SWT.BORDER); | 38 TabFolder tabFolder = new TabFolder (shell, SWT.BORDER); |
34 for (int i=0; i<6; i++) { | 39 for (int i=0; i<6; i++) { |
35 TabItem item = new TabItem (tabFolder, SWT.NONE); | 40 TabItem item = new TabItem (tabFolder, SWT.NONE); |
36 item.setText ("TabItem " ~ to!(char[])(i)); | 41 item.setText ("TabItem " ~ to!(String)(i)); |
37 Button button = new Button (tabFolder, SWT.PUSH); | 42 Button button = new Button (tabFolder, SWT.PUSH); |
38 button.setText ("Page " ~ to!(char[])(i)); | 43 button.setText ("Page " ~ to!(String)(i)); |
39 item.setControl (button); | 44 item.setControl (button); |
40 } | 45 } |
41 tabFolder.pack (); | 46 tabFolder.pack (); |
42 shell.pack (); | 47 shell.pack (); |
43 shell.open (); | 48 shell.open (); |