Debian Codegraph @

examples/forward_test

raw
1 #!/usr/local/bin/nperl -w
2 use strict;
3 use Tk;
4
5 my $mw = MainWindow->new;
6
7 $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack;
8
9 my $fr = $mw->Frame->pack;
10
11 $fr->bind('<KeyPress>', 'Whatever');
12
13 my $lab = $fr->Label(-bg => 'Yellow', -width => 50, -height => 17)->pack;
14
15 $lab->bind('<KeyPress>',[ForwardEvent => Ev(['Parent'])]);
16
17 sub Tk::Frame::Whatever
18 {
19 my $w = shift;
20 print "Whatever $w ",$w->XEvent->A,"\n";
21 }
22
23 $mw->update;
24 $lab->focus;
25
26 MainLoop;
27
28 __END__