use Tk; my $mainwindow; my @save; 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"); $frm1->Label(-text=>"TITLE")->pack(-side=>'top'); $frm3->Button(-text=>"Hide Restore", -command=>sub{ if (@save) { print join("\n",@save)."\n"; foreach my $child (@save) { push(@save, $child); $child->MapWindow(); } } else { print join("\n",$frm2->children())."\n"; foreach my $child ($frm2->children()) { push(@save, $child); $child->UnmapWindow(); } } $mainwindow->update(); })->pack(-side=>'top'); $frm2->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $frm2->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $frm2->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $frm2->Label(-text=>"buttons to specific data")->pack(-side=>'top'); $frm2->Label(-text=>"buttons to specific data")->pack(-side=>'top'); } #### 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'); }