#!/usr/local/bin/perl use strict; use warnings; use Tk; use Tk::Compound; my $mw = MainWindow->new; my $b  = $mw->Button(-command => sub { $mw->destroy() },                    )              ->pack(-expand  => 1,                     -fill    => 'x',                    ); my $i  = $b->Compound; $i->Line; $i->Text(-text => 'Line'); $i->Space(-width => '3m'); $i->Text(-text => 'one'); $i->Line; $i->Bitmap(-bitmap => 'warning'); $i->Line; $i->Text(-text => 'Line2'); $b->configure(-image => $i); my $b2 = $mw->Button(-command => sub { $mw->destroy() },                     -image   => $i,                    )              ->pack(-expand  => 1,                     -fill    => 'x',                    ); MainLoop();