views:

174

answers:

1

I have a SWT shell, with an SWT browser in it. on OSX it works fine, but when on Windows it insists on putting a disabled vertical scrollbar in the shell or browser (i don't know which!). Is there a way of forcing the widgets to hide their scroll bars?

When i call getVerticalScrollBar() or the horizontal equivilant on either the shell or the browser i get null. So is there a way of removing the scrollbars completley?

here is my code, nothing special:


    this.shell = new Shell(this.display, SWT.CLOSE | SWT.MIN | SWT.MAX);

    shell.addListener(SWT.Close, new Listener(){
        public void handleEvent(Event event) {
            event.doit = false;
            location = shell.getLocation();
            shell.setVisible(false);
        }
    });
    shell.setSize(popUpSize);
    shell.setMinimumSize(popUpSize);
    if(this.location == null){
        shell.setLocation(x, y);    
    }else{
        shell.setLocation(this.location);
    }


    shell.setLayout(new FillLayout());
    this.browser = new Browser(shell, SWT.NONE | SWT.SMOOTH);

Any ideas?

Cheers

Andy

+1  A: 

I had a similar problem with SWT browser objects. I ended up using the "overflow:hidden" CSS style in my HTML page, which tells the browser to suppress scrollbars and clip the webpage at the edge of the browser window if the page is too big to fit.

Jim Tough
More specifically, the CSS should be `overflow-y: hidden;` to allow for horizontal scrollbars. Note that this only works in IE8 (and above), so if you intend to support IE7 and below, use `overflow:hidden;overflow-x:auto;`. See also: http://msdn.microsoft.com/en-us/library/ms530829%28VS.85%29.aspx See also this question: http://stackoverflow.com/questions/1389979/force-vertical-scrollbar-to-display-in-ie8
Paul Lammertsma