I’m building a welcome editor for my eclipse rcp application. I want to have two ScrolledComposites sit side by side with a label above each.
Label 1 Label 2 Scrollable 1 Scrollable 2
Now I’m stuck in how to box.
This seems right but now I can’t get the layouts and listeners right.
- Composite A
- Composite A1
- Label 1
- Scrollable S1
- Composite A2
- Label 2
- Scrollable S2
- Composite A1
A1 should set the min Size of Scrollable S1 right? But who sets the size of S1 so that it fills the excess space? The examples I found didn’t work right.
BTW putting everything in a GridLayout didn’t work either since I couldn’t get the cell size.
Why would you need the cell size? Just set
GridLayoutdataforS1andS2to fill the cell. It’s simplest to useGridLayoutFactory:UPDATE: See examples at http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/custom/ScrolledComposite.html
Let’s say content of
s1is aComposite c1. Then you uses1.setMinSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT)). Size ofA1is irrelevant.