Perhaps I have misunderstood the OP's requirements?
But your code should work with:
#$mw->maxsize(1000,1200); #$mw->minsize(400,300);
If I understood correctly, the idea is to size the window so that all data can be shown without scrollbars, if possible.

Update: Your code is interesting. I'm not sure either one of us really understands the OP's requirement.

Update2: Now that I look at your code vs mine... The main difference is that I use pack() instead of grid(). With weird shaped GUI regions, pack() tends to work better as long as you are using enough frames. In general with more than one object, you put them into a Frame and than pack that frame into a frame. Grid() is different and I haven't used it. But this can work well if every row is the "same" (i.e., lining up the columns).

The main thing appears to be that the OP will need to calculate desired width size and then use that value to configure the window.


In reply to Re^2: Tk autosizing Scrolled widgets by Marshall
in thread Tk autosizing Scrolled widgets by olgo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.