Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » expand Label width
expand Label width [message #459297] Fri, 05 August 2005 03:39 Go to next message
Qiang Song is currently offline Qiang SongFriend
Messages: 4
Registered: July 2009
Junior Member
I put a label into a composite, and the composite uses GridLayout. The
text of the label contains 5 characters, later I set the label text to
another string containing 20 characters, then the label can't be fully
displayed, only the first 5 characters are shown. I want the label to
expand its width to fit displaying when becoming longer. Any suggestion
for that? Thanks.
Re: expand Label width [message #459307 is a reply to message #459297] Fri, 05 August 2005 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sarek.nurfuerspam.de

Hi,

Qiang Song wrote:
> I put a label into a composite, and the composite uses GridLayout. The
> text of the label contains 5 characters, later I set the label text to
> another string containing 20 characters, then the label can't be fully
> displayed, only the first 5 characters are shown. I want the label to
> expand its width to fit displaying when becoming longer. Any suggestion
> for that? Thanks.

I'd say a:

comopisteWithLabelInit.layout()

should do it.

Or you could assign a GridData object to the label and have it use the
whole space available for example - so the label would always be of the
same size and only display text of different length.

HTH

Christian

--
To reply to this posting directly use the following address and
remove the 'NO-SPAM' part: Riedel.Christian.NO-SPAM@gmx.net
Re: expand Label width [message #459323 is a reply to message #459297] Fri, 05 August 2005 14:44 Go to previous message
Max Rotvel is currently offline Max RotvelFriend
Messages: 21
Registered: July 2009
Junior Member
On Fri, 05 Aug 2005 05:39:44 +0200, Qiang Song <songq@cn.ibm.com> wrote:

> I put a label into a composite, and the composite uses GridLayout. The
> text of the label contains 5 characters, later I set the label text to
> another string containing 20 characters, then the label can't be fully
> displayed, only the first 5 characters are shown. I want the label to
> expand its width to fit displaying when becoming longer. Any suggestion
> for that? Thanks.

Add a GridData to your Label with grabExcessHorizontalSpace set to true?

--
Max - rotvel AT bolignet-aarhus DOT dk
Previous Topic:Canvas's max size.
Next Topic:Image space for TreeViewer with ITableLabelProvider
Goto Forum:
  


Current Time: Sat Apr 20 00:13:13 GMT 2024

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

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

Back to the top