1use blib;
2use Tk;
3my $mw = MainWindow->new;
4my $kind = shift;
5die "usage: $0 widgetclass" if !$kind;
6require "Tk/$kind.pm";
7my $w = $mw->$kind();
8if ($w->isa('Tk::Wm'))
9 {
10  $w->deiconify;
11 }
12else
13 {
14  $w->pack;
15 }
16$mw->update;
17$mw->after(1000);
18$mw->after(5000,[destroy => $mw]);
19MainLoop;
20