Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Browser Widget on IE, scrollbar even if not needed
Browser Widget on IE, scrollbar even if not needed [message #453462] Wed, 06 April 2005 11:26 Go to next message
Chris Seekamp is currently offline Chris SeekampFriend
Messages: 2
Registered: July 2009
Junior Member
If I use the Browser widget on Linux with Mozilla and get the
environment set up correctly, I am able to display markup
without scrollbars, etc. if I size the control large enough.
However, on Windows with IE I get a grayed out vertical scrollbar and
the whole thing is inset. I am using SWT.NONE as the style when I create
it. Anyone know how I get the stuff rendered flat without scrollbar on
Windows? I am doing this with Eclipse 3.0.1 and the browser is IE 6.

Thanks.

Chris
Re: Browser Widget on IE, scrollbar even if not needed [message #453534 is a reply to message #453462] Thu, 07 April 2005 13:33 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi,

You need to define the body tag as below.
<body style='overflow:hidden;'>

Full example:
import org.eclipse.swt.*;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.browser.*;

public class Main {

public static void main(String[] args) {
final String html = "<html><body
style='overflow:hidden;'><h1>Some javadoc here</h1><p>and some more
here</p></body></html>";
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("PRBrowser");
shell.setLayout(new FillLayout());
final Browser browser = new Browser(shell, SWT.NONE);
browser.setText(html);
shell.open();

while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
} }
}

Chris
Re: Browser Widget on IE, scrollbar even if not needed [message #453798 is a reply to message #453534] Sat, 09 April 2005 19:20 Go to previous message
Chris Seekamp is currently offline Chris SeekampFriend
Messages: 2
Registered: July 2009
Junior Member
Christophe Cornu wrote:
> Hi,
>
> You need to define the body tag as below.
> <body style='overflow:hidden;'>
>
> Full example:
> import org.eclipse.swt.*;
> import org.eclipse.swt.widgets.*;
> import org.eclipse.swt.layout.*;
> import org.eclipse.swt.browser.*;
>
> public class Main {
>
> public static void main(String[] args) {
> final String html = "<html><body
> style='overflow:hidden;'><h1>Some javadoc here</h1><p>and some more
> here</p></body></html>";
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setText("PRBrowser");
> shell.setLayout(new FillLayout());
> final Browser browser = new Browser(shell, SWT.NONE);
> browser.setText(html);
> shell.open();
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> } }
> }
>
> Chris
>
>
Thanks. Actually, someone told me about the "overflow:auto" and I tried
that and it worked. I want it to have a scrollbar when it needs one and
not otherwise. That is what "overflow:auto" does. I still had the
inset box though. I had to use "border-style:none" to get rid of that.

Thanks again.
Previous Topic:Cusomtizing TreeViewer
Next Topic:dll problem M6
Goto Forum:
  


Current Time: Fri Mar 29 12:15:34 GMT 2024

Powered by FUDForum. Page generated in 0.02433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top