[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] RowLayout resize widget height

Hello!

I really stuck with RowLayout. Is it possible to force widget to
recalculate height when its width changes, and child controls wrap
around?

For example Section displayed with following code only have single row
which does not wrap.

-----------
Section section = toolkit.createSection(body, Section.TWISTIE |
Section.EXPANDED | Section.TITLE_BAR);
section.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
// yes, it in parent with GridLayout

Composite composite = new Composite(section, SWT.NONE);
RowLayout rowLayout = new RowLayout();
rowLayout.wrap = true;
composite.setLayout(rowLayout);
section.setClient(composite);

for(int i = 0; i < 10; i++) {
Button button = new Button(composite, SWT.NONE);
button.setText("button");
}
-----------

Really appreciate your help!