comparison org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.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
comparison
equal deleted inserted replaced
111:b6e9904989ed 112:9f4c18c268b2
29 import org.eclipse.swt.widgets.Shell; 29 import org.eclipse.swt.widgets.Shell;
30 import org.eclipse.swt.layout.FillLayout; 30 import org.eclipse.swt.layout.FillLayout;
31 31
32 import java.lang.all; 32 import java.lang.all;
33 33
34 import tango.io.Console; 34 version(Tango){
35 import tango.io.Console;
36 } else { // Phobos
37 import std.stdio;
38 }
35 39
36 version(linux) { 40 version(linux) {
37 version(build) 41 version(build)
38 { 42 {
39 pragma(link, "stdc++"); 43 pragma(link, "stdc++");
51 shell.setLayout(new FillLayout()); 55 shell.setLayout(new FillLayout());
52 Browser browser; 56 Browser browser;
53 try { 57 try {
54 browser = new Browser(shell, SWT.NONE); 58 browser = new Browser(shell, SWT.NONE);
55 } catch (SWTError e) { 59 } catch (SWTError e) {
56 Cout("Could not instatiate Browser.").newline; 60 version(Tango){
61 Cout("Could not instatiate Browser.").newline;
62 } else { // Phobos
63 writeln("Could not instatiate Browser.");
64 }
57 return; 65 return;
58 } 66 }
59 browser.setText(html); 67 browser.setText(html);
60 shell.open(); 68 shell.open();
61 while (!shell.isDisposed()) { 69 while (!shell.isDisposed()) {