Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet250.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 |
---|---|
26 import org.eclipse.swt.widgets.Display; | 26 import org.eclipse.swt.widgets.Display; |
27 import org.eclipse.swt.widgets.Shell; | 27 import org.eclipse.swt.widgets.Shell; |
28 | 28 |
29 import java.lang.all; | 29 import java.lang.all; |
30 | 30 |
31 import tango.io.Stdout; | 31 version(Tango){ |
32 import tango.io.Stdout; | |
33 } else { // Phobos | |
34 import std.stdio; | |
35 } | |
32 | 36 |
33 void main (String [] args) { | 37 void main (String [] args) { |
34 Display display = new Display (); | 38 Display display = new Display (); |
35 Shell shell = new Shell (display); | 39 Shell shell = new Shell (display); |
36 shell.setLayout (new RowLayout ()); | 40 shell.setLayout (new RowLayout ()); |
37 | 41 |
38 DateTime calendar = new DateTime (shell, SWT.CALENDAR); | 42 DateTime calendar = new DateTime (shell, SWT.CALENDAR); |
39 calendar.addSelectionListener (new class() SelectionAdapter{ | 43 calendar.addSelectionListener (new class() SelectionAdapter{ |
40 void widgetSelected (SelectionEvent e) { | 44 void widgetSelected (SelectionEvent e) { |
41 Stdout("calendar date changed\n"); | 45 version(Tango){ |
42 Stdout.flush(); | 46 Stdout("calendar date changed\n"); |
47 Stdout.flush(); | |
48 } else { // Phobos | |
49 writeln("calendar date changed"); | |
50 } | |
43 } | 51 } |
44 }); | 52 }); |
45 | 53 |
46 DateTime time = new DateTime (shell, SWT.TIME); | 54 DateTime time = new DateTime (shell, SWT.TIME); |
47 time.addSelectionListener (new class() SelectionAdapter{ | 55 time.addSelectionListener (new class() SelectionAdapter{ |
48 void widgetSelected (SelectionEvent e) { | 56 void widgetSelected (SelectionEvent e) { |
49 Stdout("time changed\n"); | 57 version(Tango){ |
50 Stdout.flush(); | 58 Stdout("time changed\n"); |
59 Stdout.flush(); | |
60 } else { // Phobos | |
61 writeln("time changed"); | |
62 } | |
51 } | 63 } |
52 }); | 64 }); |
53 | 65 |
54 shell.pack (); | 66 shell.pack (); |
55 shell.open (); | 67 shell.open (); |