Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Possible to take out the vertical scrollbar for the Browser widget?
Possible to take out the vertical scrollbar for the Browser widget? [message #455354] Thu, 12 May 2005 23:29 Go to next message
Alex Le is currently offline Alex LeFriend
Messages: 649
Registered: July 2009
Senior Member
Hi,

Yes, I would like to create a Browser widget WITHOUT the vertical
scrollbar. Possible?

Thanks.
Re: Possible to take out the vertical scrollbar for the Browser widget? [message #455465 is a reply to message #455354] Mon, 16 May 2005 13:38 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
The underlying browser is in control of the scrollbar, so there is not an
swt style or api that can do this. However, the content being shown can
affect this with the "overflow" style as demonstrated below:

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();
}
}
}

If you want the scrollbars to appear/disappear as needed then use
overflow:auto.

Grant


"AL" <unbonnevie@yahoo.com> wrote in message
news:d60p0t$gnf$1@news.eclipse.org...
> Hi,
>
> Yes, I would like to create a Browser widget WITHOUT the vertical
> scrollbar. Possible?
>
> Thanks.
>
Previous Topic:Packaging with SWT
Next Topic:implement "autoscroll" with StyledText?
Goto Forum:
  


Current Time: Thu Sep 26 19:07:09 GMT 2024

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

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

Back to the top