#!/afs/sipb/project/perl5/bin/tkperl

BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)) }
use Tk;

#
# Pressing the button (with mouse button 1) invokes method flash on the
# button itself. Also, a handler for mouse button 2 is bound to the button.

$top = tkinit;
$but = Button::new($top, "-text" => "Press me");
$but->configure("-method" => "flash",
                "-slave"  => $but);
tkbind($but, "<2>", \&readout);
tkpack $but;
tkmainloop;

sub readout {
    print "This widget is $Tk::EvW\n";
    print "button says ", ($but->configure("-text"))[4], "\n";
}
