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

Hi JPaul,

I'm glad you got your sample code working. I don't have a lot to offer as to why it wasn't work as intended, except to say that I'd be it was an artifact of using Canvas as a parent for (a grid widget that is a parent for) Label widgets. Canvas has it's own methods for handling images (check $canvas->createImage()) that might be easier and more efficient for you. You could just place the image at 32 * $x, 32 * $y then. I think by squishing the images in a smaller Label widget you will create artifacts you have to deal with later.

Good luck, and if you end up with something playable, I hope you post it. :)

{NULE}
--
http://www.nule.org

  • Comment on Re: Perl/Tk grid geometry manager padding things I don't want it to
  • Download Code

Replies are listed 'Best First'.
Re: Re: Perl/Tk grid geometry manager padding things I don't want it to
by JPaul (Hermit) on Feb 10, 2002 at 00:43 UTC
    Well heck,
    That was a brilliant suggestion, and sure enough, it works real slick.
    for(my $x = 0; $x <= 9; $x++) { for(my $y = 0; $y <= 9; $y++) { my $ttile = $MW->Photo(-file => "./tiles/brick.xpm"); $canvas->createImage(32 * $x, 32 * $y, -image => $ttile); } }
    Good thinking {NULE} and much appreciated.

    JP,
    -- Alexander Widdlemouse undid his bellybutton and his bum dropped off --