Dave Cross: Still Munging Data With Perl: Online event - Mar 17 Learn more
|
AUTOSTUDY => 1,
STUDY => [ 'PerlGridBagConstraints' ];
sub new {
my $class = shift ;
if ( ref ( $_ [0]) =~ /HASH/) {
my $attributes = shift ;
my $retval = GridBagConstraints::PerlGridBagConstraints->new();
foreach my $attribute ( keys %{ $attributes }) {
my $setter = "set" . ucfirst ( $attribute );
eval { $retval -> $setter ( $attributes ->{ $attribute }); };
if ($@) {
croak "Error: '$attribute' is not an attribute of $class" ;
}
}
return $retval ;
}
else {
return GridBagConstraints::PerlGridBagConstraints->new( @_ );
}
}
1;
|