App::Harmonograph / lib / Wx / Perl / Smart /

use v5.12;
use warnings;
use Wx;
use Wx::Perl::Smart::Sizer;

package Wx::Perl::Smart::Panel;
use base qw(Wx::Panel);
use Scalar::Util qw(blessed looks_like_number);

sub new {
	my ($class, $parent, $widgets, $orientation, $init_arg) = @_;

	return warn ((caller(0))[3].': first parameter $parent is no proper WxWindow') 
			unless blessed($parent) and $parent->isa('Wx::Window');
	return warn ((caller(0))[3].': second parameter $widgets has should be ARRAY ref') unless ref $widgets eq 'ARRAY';

	my ($self)  = $class->SUPER::new( $parent );
	$self->{'sizer'} = Wx::Perl::Smart::Sizer->new($self, $widgets, $orientation, $init_arg);
	$self->SetSizerAndFit( $self->{'sizer'} );