Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Layout of Text
Layout of Text [message #688071] Thu, 23 June 2011 20:46 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
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 06:28 Go to previous message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
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
Previous Topic:a SWT control refuses to "grab excess vertical space"
Next Topic:Problem with ImageData and Relative Path
Goto Forum:
  


Current Time: Fri Apr 26 11:24:26 GMT 2024

Powered by FUDForum. Page generated in 0.03097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top