use Tk; my $mainwindow; my $save=0; mw(); MainLoop(); sub mw { $mainwindow = MainWindow->new(); my $frm1 = $mainwindow->Frame(-borderwidth=>4, -relief=>"ridge")->pack(-side=>'top', -expand=>1, -fill=>"x", -anchor=>"n"); my $frm2 = $mainwindow->Frame(-borderwidth=>4, -relief=>"ridge")->pack(-side=>'top', -expand=>1, -fill=>"both", -anchor=>"n"); my $frm3 = $mainwindow->Frame(-borderwidth=>4, -relief=>"ridge")->pack(-side=>'top', -expand=>1, -fill=>"x", -anchor=>"n"); my $container = $frm2->Frame(-borderwidth=>4, -relief=>"ridge")->pack(-side=>'top', -expand=>1, -fill=>"both", -anchor=>"n"); $frm1->Label(-text=>"TITLE")->pack(-side=>'top'); $frm3->Button(-text=>"Hide Restore", -command=>sub{ if ($save) { $container->MapWindow(); $container->raise; $save=0; } else { $container->UnmapWindow(); $save=1; } return; })->pack(-side=>'top'); $container->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $container->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $container->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $container->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $container->Label(-text=>"buttons to specific data")->pack(-side=>'top'); }