package MyToplevel; use Tk::Toplevel; @ISA = qw(Tk::Toplevel); Construct Tk::Widget 'MyToplevel'; #公開したいサブルーチン #@EXPORT = qw(); use strict; #use base qw(Tk::Widget); sub Populate { my($cw, $args) = @_; $cw->SUPER::Populate($args); return; # my $b = $cw->Toplevel(); # $b->pack(-expand => 1, -fill => 'both'); # $cw->Advertise('MyToplevel', => $b); # $cw->ConfigSpecs(DEFAULT => [$b]); # $cw->Delegates(DEFAULT => $b); } sub ClassInit { my ($class, $mw) = @_; return $class; } BEGIN { } sub new { my ($class, @args) = @_; my $self = Tk::Toplevel->new(@args); return bless $self, ref($class) || $class; } sub DESTROY { my $this = shift; $this->SUPER::DESTROY(@_); } sub SetTitle { my ($this, $title) = @_; return $this->title($this->{'Title'} = $title); } sub GetTitle { my ($this) = @_; return $this->{'Title'}; } 1;