#!/usr/bin/perl -- use strict; use warnings; use Tk; use Data::Dump qw/ dd /; my @tags = ( "<KeyPress>", "<KeyRelease>", "<ButtonPress>", "<ButtonRelease>", "<FocusIn>", "<FocusOut>", "<Expose>", "<MapRequest>", "<ConfigureRequest>", "<ResizeRequest>", "<Activate>", "<Deactivate>", "<Activate>", "<Destroy>", "<Map>", "<ButtonPress>", "<Button>", "<Enter>", "<MapRequest>", "<ButtonRelease>", "<Expose>", "<Motion>", "<Circulate>", "<FocusIn>", "<MouseWheel>", "<FocusOut>", "<Property>", "<Colormap>", "<Gravity>", "<Reparent>", "<Configure>", "<Key>", "<ResizeRequest>", "<ConfigureRequest>", "<KeyRelease>", "<Unmap>", "<Create>", "<Leave>", "<Visibility>", "<Deactivate>", ); my $mw = tkinit(); $mw->Button( qw/ -text exit -command /, sub { $Tk::widget->toplevel->destroy; } )->pack; my %seen; for my $bindtag ( @tags ) { $mw->bind( $mw, $bindtag, sub { $seen{$bindtag}++; print qq{$bindtag \$e $Tk::event \$w $Tk::widget \@_ @_\n} +; } ); } my $redirect = 0; $mw->geometry( '480x480+50+50' ); $mw->overrideredirect( $redirect = !$redirect ); $mw->withdraw; $mw->deiconify; $mw->raise; $mw->repeat( 1000, sub { $Tk::widget->overrideredirect( $redirect = !$redirect ); $Tk::widget->deiconify; $Tk::widget->raise; } ); dd \%seen; $mw->MainLoop; dd \%seen; __END__ <Visibility> $e XEvent=SCALAR(0xf45c24) $w Tk::Button=HASH(0xf56344) @ +_ Tk::Button=HASH(0xf56344) <Configure> $e XEvent=SCALAR(0xf648a4) $w MainWindow=HASH(0xf27a84) @_ + MainWindow=HASH(0xf27a84) <Expose> $e XEvent=SCALAR(0xf64864) $w MainWindow=HASH(0xf27a84) @_ Ma +inWindow=HASH(0xf27a84) <Key> $e XEvent=SCALAR(0xf28494) $w MainWindow=HASH(0xf27a84) @_ MainW +indow=HASH(0xf27a84) <FocusIn> $e XEvent=SCALAR(0xf647d4) $w Tk::Button=HASH(0xf56344) @_ T +k::Button=HASH(0xf56344) <KeyRelease> $e XEvent=SCALAR(0xf64794) $w Tk::Button=HASH(0xf56344) @ +_ Tk::Button=HASH(0xf56344) <Destroy> $e XEvent=SCALAR(0xf56514) $w Tk::Button=HASH(0xf56344) @_ T +k::Button=HASH(0xf56344) <Destroy> $e XEvent=SCALAR(0xf27b84) $w MainWindow=HASH(0xf27a84) @_ M +ainWindow=HASH(0xf27a84) { "<Button>" => 1, "<ButtonRelease>" => 1, "<Configure>" => 36, "<Destroy>" => 2, "<Enter>" => 3, "<Expose>" => 24, "<FocusIn>" => 16, "<FocusOut>" => 14, "<Key>" => 96, "<KeyRelease>" => 97, "<Leave>" => 2, "<Map>" => 25, "<Motion>" => 21, "<Visibility>" => 48, }
In reply to Re^2: Identify Tk state iconic to normal events
by Anonymous Monk
in thread Identify Tk state iconic to normal events
by WayneRas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |