use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->title("Icon test"); # comment out the next two lines to see the red Tk logo in the to left my $xpm = $mw->Photo(-file => "testicon.xpm", -format => 'xpm'); $mw->Icon(-image => $xpm); $mw->Button(-text => "Done", -command => sub { exit })->pack; MainLoop;