issue with nested Composites [message #1659503] |
Sun, 08 March 2015 21:31 |
Ralf Heydenreich Messages: 235 Registered: July 2009 |
Senior Member |
|
|
Hi all,
I've got a little confused about using nested Composites. This is what
I've written:
private Text txtInput;
private Composite top;
private TableViewer tableViewer;
public void createComposite(Composite parent) {
parent.setLayout(new GridLayout(1, true));
ScrolledComposite scrollcomposite = new ScrolledComposite(parent,
SWT.H_SCROLL | SWT.V_SCROLL);
top = new Composite(scrollcomposite, SWT.NONE );
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(top);
scrollcomposite.setContent(top);
scrollcomposite.setExpandHorizontal(true);
scrollcomposite.setExpandVertical(true);
scrollcomposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
txtInput = new Text(top, SWT.BORDER);
txtInput.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Composite nestedComposite = new Composite(scrollcomposite, SWT.BORDER);
Text textField = new Text(nestedComposite, SWT.BORDER);
tableViewer = new TableViewer(top);
tableViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
}
The point is that all widgets inside nestedComposite don't appear. But I
can't explain why. Is anybody out there who could give me a hint what's
wrong with this code?
TIA,
Ralf.
|
|
|
|
Powered by
FUDForum. Page generated in 0.14983 seconds