Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
Can you give as a small code snippet highlighting u r problem?
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
Eclipse UserFriend
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] by Moderator

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


Current Time: Wed Jul 16 12:05:10 EDT 2025

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

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

Back to the top