Readers: 10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = tkinit; my $frame = $mw ->Frame()->pack(qw/ -fill both -expand 1 /); my $text = $frame->Text() ->pack(qw/ -fill both -expand 1 /); $frame->bind( '<Motion>' => sub { print "Frame-Motion\n" } ); MainLoop;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/perl use strict; use warnings; use Tk; my $mw = tkinit; my $frame = $mw ->Frame(-height => 50, )->pack(qw/ -fill both -expand 1 /); my $text = $frame->Text() ->pack(qw/ -fill both -expand 1 /); my $label = $frame->Label(-text => 'Noch ein Widget') ->pack(qw/ -fill both -expand 1 /); $frame->bind('all','<Motion>' => sub { print "Frame-Motion\n" } ); MainLoop;