Leser: 1
4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
use Tk;
my $mw = MainWindow->new;
$mw->bind('<Activate>' => sub { print "Aktiviert\n"; });
$mw->bind('<Deactivate>' => sub { print "deaktiviert\n"; });
$mw->bind('<ResizeRequest>' => sub { print "Verändert\n"; });
MainLoop;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/perl use strict; use warnings; use Tk; my ($width,$height) = (300,400); my $mw = tkinit; $mw->geometry( $width . 'x' . $height ); $mw->bind('<Configure>', \&resize_mw); MainLoop; sub resize_mw{ my $ev = $mw->XEvent; if( $width != $ev->w or $height != $ev->h ){ $width = $ev->w; $height = $ev->h; print "Fenstergroesse veraendert\n"; } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl use strict; use warnings; use Tk; my ($width,$height) = (300,400); my $mw = tkinit; $mw->geometry( $width . 'x' . $height ); $mw->bind('<FocusIn>', \&focus_in); MainLoop; sub focus_in{ print "aktiviert\n"; }
4 Einträge, 1 Seite |