package Tk::Foon; use base qw(Tk::Derived Tk::Label); Construct Tk::Widget 'Foon'; sub ClassInit { my($class, $mw) = @_; $class->SUPER::ClassInit($mw); } sub Populate { my($self, $args) = @_; $self->SUPER::Populate($args); $self->ConfigSpecs('DEFAULT' => [ 'SELF' ]); } #### #!/usr/bin/perl -w use strict; use Tk; use Tk::Foon; my $mw = MainWindow->new; my $l = $mw->Foon(-background =>'blue', -foreground => 'red')->pack; $l->configure(-text => 'happy'); MainLoop;