in reply to Re^2: Perl/Tk: Issues with external padding
in thread Perl/Tk: Issues with external padding

Sounds completely reasonable. Each button has an invisible border ("padding") of 10 pixel, so the distance from button to button is 20 pixel. With a padding of 5 pixel per button, you get a distance of 10 pixel.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^3: Perl/Tk: Issues with external padding

Replies are listed 'Best First'.
Re^4: Perl/Tk: Issues with external padding
by unknown-monk (Novice) on May 14, 2010 at 10:02 UTC
    Yes, it sounds reasonable, but at the end it doesn't look good.
    I created a screenshot to better illustrate my situation.

    Screenshot

    The result should be that the distance of the red lines is the same like the green lines.

    Regards,
    unknown-monk
      Hi,

      you can embed the widgets enclosed by the green line in an extra frame and add padding to that frame like so:

      use warnings; use strict; use Tk; my $mw =MainWindow ->new; my $f = $mw->Frame()->pack(-ipadx => 5); $f -> Button(-width => 10)->grid(-row => 0, -column => 0, -padx => 5); $f -> Button(-width => 10)->grid(-row => 0, -column => 1, -padx => 5); MainLoop;

      Also, your screen layout looks like it could be easier defined using the Tk::pack geometry manager.

      Cheers, Chris
      update: Added example
      Would an empty frame of a given size help you?