#Stephen Lidie wrote: #There are at least two ways of doing it: ferreting out the actual #superclass callback and invoking it manually (not recommended), or #creating a proper mega-widget. The mega-widget method is cleaner and #seems to do what you want. #Here is a modified version of the Emu example. First, note that I #added Tk::Derived to the module's base class because we need to turn #this into a first class mega-widget - it's no longer a simple example. #Second, the binding has been deleted from the class #initialization method ClassInit(). ------------------------------------------------------------- use Tk; use strict; package MyButton; use base qw/Tk::Derived Tk::Button/; Construct Tk::Widget 'MyButton'; sub ClassInit { my ($class, $mw) = @_; $class->SUPER::ClassInit($mw); # $mw->bind($class, '', sub{print "Entered a MyButton\n"}); } sub Populate { my ($self, $args) = @_; $self->SUPER::Populate($args); $self->bind('', sub{print "Entered a MyButton\n"}); # my (@bt) = $self->bindtags; # $self->bindtags( [ @bt[ 1, 0, 2, 3 ] ] ); } 1; package main; my $mw = MainWindow->new; $mw->Button(-text => 'NormalButton')->pack; $mw->MyButton(-text => 'MyButton')->pack; MainLoop; #-------------------------------------------------------------- #The real change is the addition of Populate(), the class instance #constructor. It's responsible for creating the binding. Now #when you a MyButton mega-widget it behaves exactly as a normal #Button does, plus, it prints a message.