Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Dynamically resizing a CLabel based on text input?
Dynamically resizing a CLabel based on text input? [message #723171] Wed, 07 September 2011 18:19 Go to next message
dejuknow is currently offline dejuknow
Messages: 2
Registered: September 2011
Junior Member
Hello,

I'm fairly new to SWT so I'd appreciate any guidance on my issue.

I have a Label who's text changes programmatically, so the size isn't fixed. I want to place an image using CLabel immediately to the right of the text, but I can't figure out how to programmatically resize the Label control so that the image moves according to the size of the text.

I also don't want to put the text and image in the same CLabel control because I may have to programmatically move the image next to another control.

I looked through the Layout class, but the examples I saw seemed to assume a fixed control size.

Any ideas?

TIA
Re: Dynamically resizing a CLabel based on text input? [message #723205 is a reply to message #723171] Thu, 08 September 2011 00:00 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
Can you give as a small code snippet highlighting u r problem?

---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Dynamically resizing a CLabel based on text input? [message #723947 is a reply to message #723205] Fri, 09 September 2011 21:09 Go to previous message
dejuknow is currently offline dejuknow
Messages: 2
Registered: September 2011
Junior Member
Nevermind. I figured out that I have to call shell.layout() after changing the text size.

Thx though!

[Updated on: Fri, 09 September 2011 21:10]

Report message to a moderator

Previous Topic:Obtaining HTML String for fully rendered HTML given URL
Next Topic:Starting Out - Need Help
Goto Forum:
  


Current Time: Thu Aug 28 05:16:48 EDT 2014

Powered by FUDForum. Page generated in 0.08270 seconds