SWT browser not rendering until shell resize on mac [message #1696750] |
Thu, 28 May 2015 11:10 |
Kiran Kumnoor Messages: 2 Registered: May 2015 |
Junior Member |
|
|
I have a problem with the SWT browser. I am using Mac OS X Yosemite.
The browser is deeply placed in a composite hierarchy. i.e., The shell has say composite A, and composite A has composite B, and composite B has composite C and the Browser is placed inside this composite C. I've added location listeners and progress listeners for the browser.
GridDataFactory is org.eclipse.jface.layout.GridDataFactory
Composite compositeC= new Composite(compositeB, SWT.BORDER);
Browser browser = new Browser(compositeC, SWT.None);
GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);
browser.addLocationListener(new LocationListener() {
@Override
public void changing(LocationEvent event) {
}
@Override
public void changed(LocationEvent event) {
}
});
browser.addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event e) {
}
});
browser.addProgressListener(new ProgressListener() {
@Override
public void completed(ProgressEvent event) {
browser.layout(true, true);
}
@Override
public void changed(ProgressEvent event) {
}
});
browser.setUrl("http://eclipse.org");
compositeC.layout(true);
compositeC.redraw();
But the page that loads in the browser is not visible until I resize the Shell. I tried redrawing the shell in the completed() method of Progress Listener. But nothing seems to be working.
The same code works perfectly fine in Windows. Is there something I am doing wrong here or some issue with the Webkit rendered on MAC.
[Updated on: Fri, 29 May 2015 03:12] Report message to a moderator
|
|
|
Re: SWT browser not rendering until shell resize on mac [message #1696845 is a reply to message #1696750] |
Fri, 29 May 2015 02:50 |
Eclipse User |
|
|
|
Kiran Kumnoor wrote on Thu, 28 May 2015 07:10
Composite compositeC= new Composite(compositeB, SWT.BORDER);
Browser browser = new Browser(browserComposite, SWT.None);
You want to use SWT.NONE (a style bit), not SWT.None (an event). But this is just stylistic since they're both 0.
GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);
You're not showing code to set a layout on the composite.
browser.setUrl("[url]http://eclipse.org[/url]");
compositeC.layout(true);
compositeC.redraw();
|
|
|
Re: SWT browser not rendering until shell resize on mac [message #1696846 is a reply to message #1696845] |
Fri, 29 May 2015 03:17 |
Kiran Kumnoor Messages: 2 Registered: May 2015 |
Junior Member |
|
|
Brian de Alwis wrote on Fri, 29 May 2015 02:50Kiran Kumnoor wrote on Thu, 28 May 2015 07:10
Composite compositeC= new Composite(compositeB, SWT.BORDER);
Browser browser = new Browser(compositeC, SWT.None);
You want to use SWT.NONE (a style bit), not SWT.None (an event). But this is just stylistic since they're both 0.
GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);
You're not showing code to set a layout on the composite.
browser.setUrl("[url]http://eclipse.org[/url]");
compositeC.layout(true);
compositeC.redraw();
Hi Brian, I've edited the code. The layout for compositeC, which is browser's parent composite is as below.
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(compositeC);
GridDataFactory.fillDefaults().grab(true, true).applyTo(compositeC);
where both GridLayoutFactory and GridDataFactory are from
[Updated on: Fri, 29 May 2015 03:19] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02473 seconds