#!/usr/bin/perl use warnings; use strict; use Tk; # from perldoc messageBox # -icon # Specifies an icon to display. On X11 any of the # builtin Tk bitmaps can specified. On Windows only # error, info, question or warning are supported. my $mw = tkinit; $mw->fontCreate('big', -family=>'arial', -weight=>'bold', -size=>int(-18*18/14)); my $bits = pack("b8"x8, "...11...", "..1111..", ".111111.", "11111111", "11111111", ".111111.", "..1111..", "...11...",); $mw->DefineBitmap('indicator' => 8,8, $bits); $mw->Button(-text=>'Press Me', -command => sub{ my $message = localtime; &send_message( $message) } )->pack; MainLoop; sub send_message{ my $message = shift; $mw->messageBox( -background => 'lightyellow', -foreground => 'red', -icon => 'indicator', -message => $message, -font => 'big', -type => 'OK' ); }