#!/usr/local/bin/perl -w

use Tk;

# This does not work properly yet

use strict qw(subs);

use Tk::Pretty;

sub top
{
 my $name = shift;
 my $top = MainWindow->new();
 $top->Button('-text'=>"Quit",'-command'=>['destroy',$top])->pack;
 $top->Button('-textvariable'=>\$name,
              '-command'=> [ sub { my $name = shift; print "$name\n"},$name])->pack;
 $top->title($name);
}

&top("One");
&top("Two");

MainLoop;
