Skip to main content


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 22:19 Go to next message
dejuknow is currently offline dejuknowFriend
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 04:00 Go to previous messageGo to next message
Vijay RajFriend
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] Sat, 10 September 2011 01:09 Go to previous message
dejuknow is currently offline dejuknowFriend
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: Sat, 10 September 2011 01: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: Sat Apr 20 12:58:17 GMT 2024

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

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

Back to the top