I'm using XWT.
I'm implementing a widget that has a GridLayout. I don't know how many columns it will contain.
In the constructor I've the code:
- Code: Select all
GridLayout layout = new GridLayout(1, false);
layout.verticalSpacing = 1;
layout.horizontalSpacing = 1;
layout.marginHeight = 0;
layout.marginWidth = 0;
setLayout(layout);
I've also implemented the getter and setter pair for numColumns because the designer set this
value.
- Code: Select all
public void setNumColumns(int numcolumns) {
GridLayout layout = (GridLayout) getLayout();
layout.numColumns = numcolumns;
}
public int getNumColumns() {
GridLayout layout = (GridLayout) getLayout();
return layout.numColumns;
}
When I add a widget to my component the object is added correctly only if I stay on the
first row. If I add a widget on the following rows, my component mess up and put all
the widgets already present using only one column. I've noticed that the XWT file doesn't
have the property numColumns set.
Any suggestion?
thank you.