Hi,
packForget will hide the widget. You can call pack on it to display it again. The instance will stay in memory.
Unless you need $top_f again, you could use afterIdle to delay destroying the frame until the Buttons -command-callback has returned:
$bot_f->Button(-text => "Print value",
-command => sub {
print "The month is $month\n";
$top->afterIdle(sub{
$top_f->destroy if Tk::Exists($top_f);
});
}, -relief => "raised")->pack;
Cheers, Christoph |