Mercurial > projects > dwt2
comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet7.d @ 112:9f4c18c268b2
Update to compile and execute with dmd 2.052.
author | kntroh |
---|---|
date | Wed, 16 Mar 2011 21:53:53 +0900 |
parents | 4e5843b771cc |
children | 536e43f63c81 |
comparison
equal
deleted
inserted
replaced
111:b6e9904989ed | 112:9f4c18c268b2 |
---|---|
28 import org.eclipse.swt.widgets.Table; | 28 import org.eclipse.swt.widgets.Table; |
29 import org.eclipse.swt.widgets.TableItem; | 29 import org.eclipse.swt.widgets.TableItem; |
30 | 30 |
31 import java.lang.all; | 31 import java.lang.all; |
32 | 32 |
33 import tango.core.Thread; | 33 version(Tango){ |
34 import tango.util.Convert; | 34 import T = tango.core.Thread; |
35 import tango.util.Convert; | |
36 } else { // Phobos | |
37 import T = core.thread; | |
38 import std.conv; | |
39 } | |
35 | 40 |
36 void main (String [] args) { | 41 void main (String [] args) { |
37 Display display = new Display (); | 42 Display display = new Display (); |
38 Image image = new Image (display, 16, 16); | 43 Image image = new Image (display, 16, 16); |
39 GC gc = new GC (image); | 44 GC gc = new GC (image); |
44 Shell shell = new Shell (display); | 49 Shell shell = new Shell (display); |
45 shell.setText ("Lazy Table"); | 50 shell.setText ("Lazy Table"); |
46 shell.setLayout (new FillLayout ()); | 51 shell.setLayout (new FillLayout ()); |
47 Table table = new Table (shell, SWT.BORDER | SWT.MULTI); | 52 Table table = new Table (shell, SWT.BORDER | SWT.MULTI); |
48 table.setSize (200, 200); | 53 table.setSize (200, 200); |
49 Thread thread = new Thread({ | 54 T.Thread thread = new T.Thread({ |
50 for(int i=0; i< 20000; i++){ | 55 for(int i=0; i< 20000; i++){ |
51 if (table.isDisposed ()) return; | 56 if (table.isDisposed ()) return; |
52 | 57 |
53 int [] index = [i]; | 58 int [] index = [i]; |
54 display.syncExec (new class() Runnable{ | 59 display.syncExec (new class() Runnable{ |