Strictly, you should try to make your GUI adapt to the environment instead of the other way round. Thus, you should make your text widgets either have appropriate wrapping (character-wrap or word-wrap) or turn off wrapping and put a horizontal scrollbar on them. With that done, you can then maximise the overall window and things will (well, should; it depends on getting the layout instructions right) just adapt.
But if you want to do it the other way, get the font that you want to do the measuring with (because all fonts are different, and the font size matters a lot obviously) and use its measure
method to work out just how wide things are. Ideally you'll measure the real text (this matters a lot with a variable width font) but if you don't know it, you can instead make a string of repeated 0
characters and measure that. (I suggest 0
as that's the “default” character that Tk uses internally in situations where it doesn't have a better choice available, and it's between i
and M
in width in most fonts; you might as well use the same idea.)