#!/usr/bin/perl -w use strict; use Tk; use Tk::ProgressBar; # Main Window my $mw = new MainWindow; # take out your geometry line to see what is happening, # see how it resizes after removing the following line # $mw->geometry("1600x900"); #GUI Building Area #make the 2 header frames my $topframe = $mw->Frame()->pack(-expand=>0, -fill=>'x'); my $secframe = $mw->Frame()->pack(-expand=>0, -fill=>'x'); my $label = $topframe ->Label (-text => "first", -foreground => "blue", -font => "Arial 7") ->pack(-fill => 'x'); $label = $secframe ->Label (-text => "second", -foreground => "blue", -font => "Arial 12") ->pack(); # notice no fill on this button my $mainframe = $mw->Frame->pack(-expand=>1, -fill=>'both'); # make subframes for the rest, so you can add buttons my %frames; foreach my $pos('third','forth','fifth','rest'){ $frames{$pos} = $mainframe->Frame(-bg=>'white')->pack(-side=>'left', -expand=>1, -fill=>'both'); my $label = $frames{$pos} ->Label (-text => $pos, -foreground => "blue", -font=> "Arial 10") ->pack (-side => 'top', -anchor => 'nw', -ipadx => '50', -fill => 'x'); ############################################### # # Creating the button my $button = $frames{$pos}->Button( -text => 'Create car folders '. $pos, -bac => 'lightblue', -width => '17', -command => \&push_button)->pack(-side => 'top', -anchor=>'nw'); } MainLoop;