Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SWT standalone scrollbar widget

Tags:

scrollbar

swt

Is there a way to create a "standalone" scrollbar in SWT? I would like to have a scrollbar which I have full control over myself and use it to control the contents of another widget in a way which isn't possible with the "built-in" scrollbars in the Table widget, for example.

like image 643
JesperE Avatar asked Sep 24 '26 02:09

JesperE


1 Answers

I agree that you probably can't get a scrollbar alone, but I've worked around that with using a Canvas ( or ScrolledComposite ) and then set the content of that composite to exactly the same size as the ScrolledComposite.getClientArea(). That may require a bit fine tuning and you have to make sure that the content component resizes together with the ScrolledComposite, but should be possible.

You can then get the Scrollbars of the ScrolledComposite and use them independently of the ScrolledComposite.

like image 152
derBiggi Avatar answered Sep 27 '26 16:09

derBiggi