Heh
#!/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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.