v4169sgr has asked for the wisdom of the Perl Monks concerning the following question:

I am using ActiveState's Perl on windows, using Tkx.

What I would like to do is return a list of slaves to a widget e.g. a frame, and loop over them to add padding. Saves typing ;-)

But the following code snippet does not compile for me:

my @kids = $session_frame->g_packSlaves(); foreach (@kids) { $_->g_pack(-padx => 5, -pady => 5); }

What am I doing wrong?

Thanks!

Replies are listed 'Best First'.
Re: Tkx: return list of slaves
by Anonymous Monk on Sep 18, 2009 at 15:18 UTC
    You need to repack ( pack forget, then pack)

      Thanks for your reply, but I was wondering how to do this in Tkx:

      sub repack_kids { my @kids = $mw->packSlaves; foreach (@kids) { %packinfo = $_->packInfo(); $_->pack(-padx => 20 + $packinfo{"-padx"}, -pady => 20 + $packinfo{"-pady"}); } }