#!/usr/local/bin/perl -w use Tk; require Tk::Pretty ; $top = MainWindow->new(); $label = $top->Label("-text" => "Something" ); $label->bind('' , sub { printf "RIP %s\n", shift->PathName }); $top->bind('' , sub { printf "top RIP %s\n", shift->PathName }); $label->pack; $quit = $top->Button("-text" => "Quit", "-command" => ["destroy",$top]); $quit->pack; $top->update(); Tk::MainLoop();