Gertje
Joined: 25 Apr 2005 Posts: 9
|
Posted: Wed Jan 25, 2006 4:12 am Post subject: browser bug? |
|
|
Hello, I wrote the following program:
Code: |
import dwt.all;
version = OLE_COM;
version(build){
debug{
pragma(link, "dwtd.lib");
}else{
pragma(link, "dwt.lib");
}
pragma(link, "advapi32.lib");
pragma(link, "comctl32.lib");
pragma(link, "gdi32.lib");
pragma(link, "shell32.lib");
pragma(link, "comdlg32.lib");
pragma(link, "ole32.lib");
pragma(link, "uuid.lib");
pragma(link, "phobos.lib");
pragma(link, "user32_dwt.lib");
pragma(link, "imm32_dwt.lib");
pragma(link, "shell32_dwt.lib");
pragma(link, "msimg32_dwt.lib");
pragma(link, "gdi32_dwt.lib");
pragma(link, "kernel32_dwt.lib");
pragma(link, "usp10_dwt.lib");
pragma(link, "olepro32_dwt.lib");
pragma(link, "oleaut32_dwt.lib");
pragma(link, "oleacc_dwt.lib");
}
public void main(char[][] args)
{
Shell shell;
try
{
Display display = new Display();
shell = new Shell(display);
Browser browser = new Browser(shell, DWT.NONE);
char[] html = "<html><title>Title</title><body><p>Hello World!</p></body></html>";
if(!browser.setText(html))
throw new Exception("Error at rendering");
// browser.setUrl("http://www.google.com");
shell.setLayout(new FillLayout());
shell.layout();
shell.setText("Browser Test");
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}catch(Exception e){
MessageBox.showMessage(e.toString(), "Exception", shell);
}
}
|
The program does not do what I want it to do, I think I should render Hello World, but instead it stays blank. When I use setUrl instead it works like a charm! Is this a bug or am I doing something wrong?
Thanks! Geert |
|