Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » scrollbars don't scroll in Composite(no scrolling allowed!)
scrollbars don't scroll in Composite [message #1779800] Fri, 12 January 2018 20:22 Go to next message
Beth Arnold is currently offline Beth ArnoldFriend
Messages: 3
Registered: January 2018
Junior Member
I'm sure this has been answered before, but I just can't find it.
Eclipse Helios RCP code
Java 1.6

Now that everyone has finished laughing ...
I added a Composite inside another composite and I run through a loop, adding an unknown number of buttons to the second Composite. I did try using a ScrolledComposite, but can't get the buttons to appear in it, so I'm using a vanilla Composite. The scrollbars appear, but don't do anything.

Code speaks louder than words. I've left stuff out, but this is the gist. I'm sure there's something simple I've left out, like enabling scrolling or reciting the Pledge of Allegiance.

Composite wComp1 = new Composite(wComp, SWT.V_SCROLL|SWT.H_SCROLL);
wComp1.setBackground(null);

setControl(wComp1);
wComp1.setLayout(new FormLayout());

wData = new FormData();
wData.top = new FormAttachment(wLastControl, 20);
wData.left = new FormAttachment(0, 10);
wData.right = new FormAttachment(100, -10);
wData.bottom = new FormAttachment(100, -10);
wComp1.setLayoutData(wData);

try {
//get the data
pCodes[] = ...... (omitted)

for (int i = 0; i < pCodes.length; i++) {
if (pCodes[i].getPayerBypassCode() != BigInteger.ZERO) {
Button wButton = new Button(wComp1, SWT.CHECK);
wButton.setBackground(null);
wData = new FormData();
wData.left = new FormAttachment(0, 25);
wData.top = new FormAttachment(wLastControl, 5);
wButton.setLayoutData(wData);
addPayerBypassButton(wButton, pCodes[i]);
wButton.addSelectionListener(new SelectionListener() {
---------------------------------------------------------------------------------------------------------------

Appreciate any help!

Re: scrollbars don't scroll in Composite [message #1779815 is a reply to message #1779800] Sat, 13 January 2018 08:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29183
Registered: July 2009
Senior Member
I'm not sure the answer, but perhaps the SWT Snippets contain an example https://www.eclipse.org/swt/snippets/ if you search for the word "scroll" on that page.
Re: scrollbars don't scroll in Composite [message #1779836 is a reply to message #1779815] Sun, 14 January 2018 08:50 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3076
Registered: July 2009
Senior Member

Does anything look amiss other than the scrolling not being available?

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: scrollbars don't scroll in Composite [message #1779997 is a reply to message #1779836] Tue, 16 January 2018 12:52 Go to previous messageGo to next message
Beth Arnold is currently offline Beth ArnoldFriend
Messages: 3
Registered: January 2018
Junior Member
Nothing looks bad. The checkboxes appear, but continue off the viewable area. I'm unable to scroll down to view more boxes.
Re: scrollbars don't scroll in Composite [message #1780046 is a reply to message #1779997] Tue, 16 January 2018 19:10 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3076
Registered: July 2009
Senior Member

What layout is wComp (not wComp1) using?

Nitin Dahyabhai
Eclipse Web Tools Platform
Re: scrollbars don't scroll in Composite [message #1780049 is a reply to message #1780046] Tue, 16 January 2018 20:02 Go to previous message
Beth Arnold is currently offline Beth ArnoldFriend
Messages: 3
Registered: January 2018
Junior Member
wComp.setLayout(new FormLayout());
Previous Topic:eclipse installer problem
Next Topic:Tiny icons with eclipse oxygen on HIDPI resolution (3840x2160) with UBUNTU 16.04
Goto Forum:
  


Current Time: Mon Feb 19 02:50:18 GMT 2018

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

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