Layout of Text [message #688071] |
Thu, 23 June 2011 16:46  |
Eclipse User |
|
|
|
Hi,,
in a composite I use a FormToolkit to add widgets to a composite. A Text widget I add using:
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.heightHint = 64;
Text text = toolkit.createText(parent, "", SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
text.setLayoutData(gridData);
When I fill content to that field, everything is ok, that means, it fills the width of the page and it's height is as expected.
But when I change the window size, the layout does not adjust the width of the widget according to the page width, but according to the text in the widget. If the text is extremly long, the widget grows and a horizontal scrollbar on the composite shows up.
Has anybody a hint how I can change this?
Thank you!
|
|
|
Solved: Layout of Text [message #688197 is a reply to message #688071] |
Fri, 24 June 2011 02:28  |
Eclipse User |
|
|
|
Hi,
I have found a workaround for this:
I set the widthHint to an arbitrary value (e.g. 200). After this addition, the layout works as expected. But: is this the way to go?. I have forgotten: I work with Eclipse e4 RC5a.
Bye
|
|
|
Powered by
FUDForum. Page generated in 0.04650 seconds