#!/usr/bin/perl -- use strict; use warnings; use Tk; my $mw = tkinit; $mw->Label( -text => "yo" )->pack; my $en = $mw->Entry( -text => "yo" )->pack; my $bb = $mw->Button( -command => \&warner )->pack; BuhBind( $mw, '' ); ## mouse enter BuhBind( $en, '' ); ## mouse enter BuhBind( $mw, '' ); BuhBind( $en, '' ); ## $mw->WidgetDump; ## debuggery $mw->MainLoop; sub BuhBind { my( $wig , $tag ) = @_; my $str = "$wig -> bind( $tag "; $wig->bind( $tag => sub { warn " $str ## @_ ## $Tk::widget \n"; return Tk->break ; ## do not propagate, if $en is responding to return $mw doesn't have to } ); } sub warner { warn "warner ## @_ ## $Tk::widget \n"; }