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

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
  • Comment on Re^4: Perl/Tk: Issues with external padding

Replies are listed 'Best First'.
Re^5: Perl/Tk: Issues with external padding
by lamprecht (Friar) on May 15, 2010 at 09:52 UTC
    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
Re^5: Perl/Tk: Issues with external padding
by choroba (Cardinal) on May 14, 2010 at 11:08 UTC
    Would an empty frame of a given size help you?