in reply to A question regarding Perl::Tk, pack

#!/usr/bin/perl -- use strict; use warnings; use Tk qw/ tkinit /; my $mw = Tk::MainWindow->new; my $top = $mw->Frame(qw'-bg red' )->pack(qw/ -expand 1 -fill b +oth -side top /); my $bottom = $mw->Frame(qw'-bg blue' )->pack(qw/ -expand 1 -fill +both -side bottom /); my $topleft = $top->Pane(qw'-bg pink' )->pack(qw/ -expand 1 -fill +both -side left /); my $topright = $top->Pane(qw'-bg purple' )->pack(qw/ -expand 1 -fil +l both -side right /); my $botleft = $bottom->Pane(qw'-bg green' )->pack(qw/ -expand 1 -f +ill both -side left /); my $botright = $bottom->Pane(qw'-bg orange' )->pack(qw/ -expand 1 - +fill both -side right /); $mw->MainLoop;

Replies are listed 'Best First'.
Re^2: A question regarding Perl::Tk, pack (four panels four square)
by Shumkar (Novice) on Mar 30, 2016 at 06:30 UTC
    Aha! The trick was in creating 2 frames-containers. The first for A, B and the second for C, D. And I was wasting time trying to do the same with one frame-container (not possible with pack?).

      And I was wasting time trying to do the same with one frame-container (not possible with pack?).

      No, I dont think its possible,

      the docs say Tk::pack - Geometry manager that packs around edges of cavity, a geometry manager that arranges the children of a parent by packing them in order around the edges of the parent.

      Once the Panes are arranged on the edges, two on top and two on bottom, there is no option for them to be expanded half way, so they'll either be stacked vertically or horizontally

        Clear now. Thank you, and all who responded.