Sounds like you are on the right track.
You just need to determine the length of the longest text string (as you have done for "txt_areas" already.
If you have more than one text string then find out what the length of each string is and then determine which one is longer.
You could use ... box_wid = MAX (txt_w_1, txt_w_2, ... txt_w_n) ... to do this, where "txt_w_1" etc. are the widths of each of your text strings.
It won't matter what text values are typed in for each of your text parameters by the user as this will determine which is the longest.
You can also set a minimum known length so you box can never be less than a certain size.
i.e. MAX (3.25, txt_w_1, txt_w_2, ... txt_w_n)
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11