#!/usr/bin/perl use Tk; $mw = MainWindow->new; $l = $mw->Label(-text => "Test")->pack; $f = $l->Frame; $b = $mw->Button(-text => "Toggle visibility", -command => sub { if ($f->manager) { $f->placeForget; } else { $f->place(-x => 0, -y => 0, -relwidth => 1, -relheight => 1, ) } })->pack; MainLoop;