| [news.eclipse.platform.swt] Re: Changing font of Label in a Composite |
All,
I have a Composite that contains several Label objects in a single column. By default, they are displayed using the parent's default Font.
Each Label will be redrawn in bold during program execution at least once. I accomplish this by setting the bold font on one of them and redrawing the Composite. The downside is that when a label turns bold, it takes up more space, and part of it will get hidden under the Composite to the right.
What I need to do is have each Label compute its size as if it were bold so that the Composite sets itself to a more ideal size. My ultimate goal is to have it so that the wrapping of the labels and the Composite size is constant throughout execution.
I have a few ideas of how to do this. I would like to avoid writing a custom Layout. I figure I'd check with the forum to see what other ideas are out there.
Hope this helps, Eric