Morning ...

I can't replicate your problem on my system (Perl 5.004.04 on Sun Solaris, running Tk 400.202) - it seems to align OK for me.

Something I did notice is that you're using only alternate rows in the grid when you're laying out the widgets. With my version of Tk, this has the same effect as using consecutive rows: grid doesn't leave any extra space for the empty rows.

It's possible that it's this that's causing the bad alignment in your version of Perl/Tk, and it might be worth trying using consecutive rows, and then adding additional spacing using the ipad and pad options to increase the size of the cells, if that's what you needed/were trying to do.

Alternatively, it's maybe worth looking at pack or one of the other layout managers, and seeing if they can do what you need any more reliably.

Hope that helps.

-- Foxcub
#include www.liquidfusion.org.uk


In reply to Re: Tk Misalignment by Tanalis
in thread Tk Misalignment by Lhamo_rin

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.