Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] SWT 101

By the way, I forgot in my previous mail to tell you that you have to set
the gridlayoutdata to the label:

		GridData layoutData=new GridData();
		layoutData.grabExcessHorizontalSpace=true;
		layoutData.horizontalAlignment=GridData.FILL;
		label.setLayoutData(layoutData); //<---- forgot this one

Another remark to make is that this behaviour is natural. Imagine that
setting the text of label would trigger the recalculation of its size, and
trigger the recalculation of its container's size. That would have been
needed to address your your problem *automatically*. Then, it would also
logically trigger the recalculation of its container's container's size and
so on, all the way up to the root container. Such strategy would mean that
SWT would be re-calculating sizes continuously and take forever to show a
simple shell with a few components and subcomponents. It's just not
desirable, and I guess you would be amongst the first to complain about it
... (just a joke :))



Back to the top