[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Multi Line Text or StyledText Widget
|
"Brian Tanner" <btanner@xxxxxxxxxxxxxxx> wrote in message news:bb401n$9ds$1@xxxxxxxxxxxxxxxx
> Just wondering if anyone can help me out to set the dimensions of a
> multi-line text widget -- similar to a textarea in HTML.
>
> I know I can make it fit the size of a string if I do a settext.... but how
> can I leave it empty and have it be a fixed number of lines.
You can get the line height using (Styled)Text.getLineHeight and calculate the number of pixels that a given number of lines need.
If you are using a GridLayout you can then set the heightHint in the GridData of the (Styled)Text widget.
Knut