[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Layout problem with Text

Steffen wrote:
Hi,

I have a (single line) text widget in a scrolled form and want to let the widget fill the space left in a row (so using GridLayout I turned grab excess horizontal space on). Unfortunately the text widget grows also if the containing text exceeds the available space and therefore the scroll bar becomes visible. How can I configure the layout to let widget fill and grab excess space without exceeding the available space?

It's kind of hard to debug without a complete snippet of code, but here's a shot in the dark: try setting the widthHint of the Text GridData to 1 but keep the horizonalAlignment as FILL and the grabExcessHorizontalSpace as true. The widthHint should cause the layout to think the preferred size of the Text is only 1 pixel (to keep it from causing the parent to grow), and the FILL+grabExcessHorizontalSpace should tell it to fill whatever space the parent does give it.


Hope this helps,
	Eric