Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scrollbar freezes when dragging a sashbar
Scrollbar freezes when dragging a sashbar [message #460956] Tue, 13 September 2005 08:28
Eclipse UserFriend
Originally posted by: herr_bugenhagen.yahoo.de

Hello!

I want to create a user interface that consists of the following components:
A sashform that contains two composites.
The right composite contains a fixed sized ScrolledComposite with a
vertical scrollbar and another composite that fills the rest of the
right composite.

The problem is that when I drag the sashbar to the left (sometimes I
have to do it twice), the scrollbar sort of freezes and cannot be used
anymore, it does not respond to mouseclicks. When I drag the sashbar to
the right, the scrollbar becomes usable again. Evertime I move the
sashbar to the left, the scrollbar becomes unusable.

Maybe someone can help me with this problem?
I'm using WinXP, the SWT-win32-3138.dll and the swt-jar from eclipse 3.1

I wrote some sample code that shows that behavior on my computer:

public class NewSWTApp extends org.eclipse.swt.widgets.Composite {
public NewSWTApp(Composite parent, int style) {
super(parent, style);
initGUI();
}

/**
* Initializes the GUI.
*/
private void initGUI() {
this.setSize(800, 400);
this.setLayout(new FillLayout());

SashForm sf = new SashForm(this, SWT.NONE);

Composite left = new Composite(sf, SWT.NONE);
Color col = new Color(Display.getCurrent(), 255, 0, 0);
left.setLayout(new FillLayout());
left.setBackground(col);
col.dispose();

GridLayout gl = new GridLayout();
gl.numColumns = 2;
gl.makeColumnsEqualWidth = false;

GridData gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;

Composite right = new Composite(sf, SWT.NONE);
right.setLayout(gl);
right.setLayoutData(gd);

gd = new GridData();
gd.widthHint = 200;
gd.grabExcessVerticalSpace = true;
gd.verticalAlignment = SWT.FILL;
Composite c1 = new Composite(right, SWT.NONE);
col = new Color(Display.getCurrent(), 255, 0, 0);
c1.setBackground(col);
c1.setLayoutData(gd);
c1.setLayout(new FillLayout());
col.dispose();

col = new Color(Display.getCurrent(), 0, 0, 255);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.horizontalAlignment = SWT.FILL;
Composite c2 = new Composite(right, SWT.NONE);
c2.setBackground(col);
c2.setLayoutData(gd);
col.dispose();

ScrolledComposite sc = new
ScrolledComposite(c1,SWT.V_SCROLL | SWT.H_SCROLL);
col = new Color(Display.getCurrent(), 0, 255, 0);
sc.setBackground(col);
col.dispose();
}
}

Thanks,
Christoph
Previous Topic:BSF4REXX and SWT
Next Topic:Tree: How to cast from IStructuredSelection to Model objects?
Goto Forum:
  


Current Time: Fri Apr 19 01:20:53 GMT 2024

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

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

Back to the top