Calculating the width of a string

I don’t see a way to delete a post or I’d scrap this one … I found TextList (ListBox in other languages) and will absorb the sizing information, making most of the post below, moot.

However, in setting the font, I saw that PanoramaX didn’t have Courier or New Courier but does have CourierNewPSMT. So, in my system, PanX has its set of fonts and something like TextEdit or MSWord has its own set. I’ll have to do homework on Fonts because I often use mono-spaced or need a slashed zero.

I’ve made my text list and dumped a dictionary into it so good for now.


If I had, on the fly, various width strings I’d want for a title in list box, I think I’d need to know their physical width to specify (in programming) the dimension of the list box. Is there a handy way to do that?

I imagine, for any given Font/Size/Style, and Mono-Spaced (i.e. Courier) I could create some strings and measure them to determine a constant “w” so my string width would be w x the number of characters in the string.

Or is there a fancier way to have objects with text fields “grow” to a width wide enough to show a full line without cropping or wordwrap?

Nevertheless, it‘s worth reading measuretext( function

For future reference, if you look below your post, you will see some tools that look like this.

image

Click on the three dots, and it will open up to show more tools.

image

If the post was a reply, or a topic that no one has replied to, you can click the trash can to delete it. There have also been a couple of occasions where users have flagged their own topics, asking a moderator to delete, and that was done.

I wonder how quickly you’d have to do that to prevent it being sent to those of us who receive all the forum posts by e-mail.

Ah, the old, “click on the ellipses” routine. I guess it best to leave the post as it provides, “find the hidden trash can” info and measuretext( which could be of unmeasurable help.

I believe outgoing emails are delayed 10 minutes to allow for corrections before they are generated.