Hey folks,

I've just started learning Perl/Tk (Whoa, is that cool... A GUI? Who'd a thunk it) and am starting by attempting to make a simple old-school RPG like game.
My very first exercise was to draw a couple of tiles (walls/floor/empty space) and then have Perl/Tk stick them into a window to form the floorplan.
After a bit of trial-and-error, I have some semi-working code, but from somewhere there is some padding appearing (about 5 pixels or so) around my tiles, making a rather nice griddle effect, that somewhat breaks up whats supposed to be a continuous floorplan.
The manpage says the padding defaults to 0 (I also specifically told it to pad 0, to no effect) and I can't seem to find anything in the POD, or my Advanced Perl Programming (which only VERY lightly touches on the grid manager) as to explain this padding.
Don't suppose anyone could be a champ and point out what I'm doing wrong, or what I'm not supplying?

my $MW = Tk::MainWindow->new; my (@pl) = qw/-side top -expand yes -padx 10 -pady 10 -fill both/; my $frame = $MW->Frame->pack(@pl); my $canvas = $frame->Canvas(-width => 320, -height => 320)->grid; for(my $x = 0; $x <= 9; $x++) { for(my $y = 0; $y <= 9; $y++) { my $ttile = $MW->Photo(-file => "./tiles/brick.xpm"); my $label = $canvas->Label(-image => $ttile, -height => 32, -width => 32) ->grid(-row => $x, -col => $y); } } $canvas->update; MainLoop;
JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --

In reply to Perl/Tk grid geometry manager padding things I don't want it to by JPaul

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.