Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scroll bar handling - how to get a reference to a visible scroll bar?
Scroll bar handling - how to get a reference to a visible scroll bar? [message #442498] Sun, 05 September 2004 04:29 Go to next message
Eclipse UserFriend
Originally posted by: lcohen.free.fr

Hi All,

I'm writing a diff-like application where I have a view of 2 different versions of the same content, each displayed as
HTML content within a SashForm through a Browser control.

This gives me this basic hierarchy of controls:

SashForm
Left side: composite1
custom composite1
Browser control1
Right side: composite2
custom composite2
Browser control2

I'm trying to synchronize the vertical scrolling of the 2 views, but for the life of me, I can't seem to get a reference
to the vertical scrollbars on my control, even though I can see them when I run the app.

I tried: composite1.getVerticalBar(), custom_composite1.getVerticalBar() and browser1.getVerticalBar(), but they all
return null.
I also tried to define my controls with the SWT.V_SCROLL style, but this actually gives me 2 scroll bars on each side,
which is kind of ugly.

What is the part that I missed or failed to understand as to how to work with scrollbars?
I'm getting short of things to try and didn't find much litterature on this specific topic.
I'll happily welcome any hint, insight or advice.

Thanks for your time,
-Laurent
Re: Scroll bar handling - how to get a reference to a visible scroll bar? [message #442526 is a reply to message #442498] Tue, 07 September 2004 14:43 Go to previous message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Hi,

The Browser widget will turn on and off the scrollbars based on the HTML
content. It is currently not possible to access these scrollbars directly.
You can open a feature request (Platform / SWT).

An alternative way is to use a single Browser and render both sources into
one HTML page - using CSS or a table to show the diff content into 2 columns
facing each other. Or you could also decide to use 2 frames and synchronize
them using javascript as indicated below.
Example:
http://www.webreference.com/programming/javascript/jf/column 4/fscroll_main.htm
Code:
http://www.webreference.com/programming/javascript/jf/column 4/

Chris
Previous Topic:Listener for SashForm
Next Topic:Problem with "Iceman's Jaguar Theme"
Goto Forum:
  


Current Time: Wed Sep 25 03:16:34 GMT 2024

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

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

Back to the top