Mercurial > projects > dwt-linux
annotate helloworld.d @ 54:8f049b136add
first example working
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Jan 2008 14:31:37 +0100 |
parents | f0cac58ac62b |
children | a5c274fa5af9 |
rev | line source |
---|---|
36
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 module helloworld; |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 import dwt.SWT; |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 import dwt.widgets.Display; |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 import dwt.widgets.Shell; |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 |
54 | 7 import tango.io.Stdout; |
8 import tango.math.Math; | |
9 import tango.text.convert.Format; | |
10 import tango.util.Convert; | |
11 import tango.util.PathUtil; | |
12 import dwt.graphics.Device; | |
13 import dwt.graphics.ImageData; | |
14 | |
15 | |
16 import dwt.accessibility.AccessibleObject; | |
17 import dwt.accessibility.AccessibleFactory; | |
18 import dwt.SWT; | |
19 import dwt.dwthelper.File; | |
20 import dwt.widgets.Display; | |
21 import dwt.internal.Library; | |
22 import dwt.internal.Platform; | |
23 import dwt.internal.image.PngChunk; | |
24 import dwt.internal.image.JPEGFileFormat; | |
25 import dwt.internal.gtk.OS; | |
26 | |
27 import jive.stacktrace; | |
28 | |
36
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 void main(){ |
54 | 30 |
31 TraceConfig.throwOnAll = true; | |
32 try{ | |
33 Display display; | |
34 Shell shell; | |
36
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 |
54 | 36 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); File.static_this(); |
37 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Library.static_this(); | |
38 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Platform.static_this(); | |
39 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); OS.static_this(); | |
40 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); SWT.static_this(); | |
41 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); AccessibleObject.static_this(); | |
42 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); AccessibleFactory.static_this(); | |
43 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); ImageData.static_this(); | |
44 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Device.static_this(); | |
45 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); Display.static_this(); | |
46 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); PngChunk.static_this(); | |
47 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); JPEGFileFormat.static_this(); | |
48 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); | |
49 | |
50 Stdout.formatln( "main entered" ); | |
51 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); display = new Display(); | |
52 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell = new Shell(display); | |
53 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.setText("Simple SWT Sample"); | |
54 Stdout.formatln( "trc {}:{}", __LINE__, __FILE__ ); shell.open(); | |
55 Stdout.formatln( "loop entered" ); | |
56 while (!shell.isDisposed()) { | |
57 if (!display.readAndDispatch()) { | |
58 display.sleep(); | |
59 } | |
36
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 } |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 } |
54 | 62 catch (Exception e) |
63 { | |
64 Stdout.formatln (e.toString); | |
65 } | |
36
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 } |
f0cac58ac62b
added helloworld, certainly not yet compiling/working
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 |