Source

App::Harmonograph / lib / Wx / Perl / Smart / Frame.pm

Full commit
use v5.12;
use warnings;
use Wx;
use Wx::Perl::Smart::Sizer;
use Wx::Perl::Smart::Panel;

package Wx::Perl::Smart::Frame;
use base qw(Wx::Frame);
use Scalar::Util qw(blessed looks_like_number);
#sub new {
	#my ($class, $parent, $widgets, $border) = @_;
	#return unless ref $widgets eq 'ARRAY';

	#my ($self)  = $class->SUPER::new( $parent );
	#my $callback = sub { $_[0]->Reparent($self) if $_[0]->isa('Wx::Window') };
	#$self->{'sizer'} = Wx::Perl::Sizer->new($widgets, undef, $border, $callback);
	#$self->SetSizerAndFit( $self->{'sizer'} );
	#$self;
#}

sub SubscribeWidgets {
	my ($self, $widgets) = @_;
	#my $widgets = shift
	#for my $widget
	#die unless 
}

sub SetSmartLayout {
	my ($self) = shift;
#say $self->GetParent;# 

	$self->SetSizerAndFit( 
		Wx::Perl::Smart::Sizer->new(undef, [ 
			Wx::Perl::Smart::Panel->new( $self, [ @_ ] ) 
		])
	);
}

1;