#!/usr/bin/env perl use strict; use warnings; use Tk; my $mw = MainWindow->new; my $f1 = $mw->Frame()->pack; my $f2 = $mw->Frame()->pack; my $l1 = $f1->Label(-text => 'Image here')->pack; $f2->Button(-text => 'Show', -command => sub { $f1->pack(-before => $f2); })->pack; $f2->Button(-text => 'Hide', -command => sub { $f1->packForget; })->pack; $f2->Button(-text => 'Quit', -command => sub { exit; })->pack; MainLoop;