I am working on prettying a kind of word cloud that uses staticTexts and (Peter Damoc’s) version of a flow sizer. I’d like the words to be placed in a scrolledwindow or scrolledpanel but with the size of that panel at a “good” size. Here, “good” means that the flowing words are fit well, with a small margin around all four sides and therefore form a roughly square shape, which is aesthetically pleasing. The words will all be in different font sizes to represent frequency of use.
One probably overkill way of doing this is to calculate a best size based on the number of words and their various font sizes. That seems potentially difficult, though I haven’t tried.
But it seems like if I could just set the width to be fixed (or maybe a few fixed widths, each kicking in after 10, 30, 50 words) and could catch when the scroll bars get activated, I could then just add a small increase in the height of the panel to nicely fit the words.
So is there a way to catch when scroll bars appear and then quickly resize the panel?
Or is there a better way to do this?
Thanks,
Che