Source

Kephra / lib / Kephra / App / Window.pm

Full commit
use strict;
use warnings;
require Wx;

package Kephra::App::Window;
our @ISA = 'Wx::Frame';

sub new {
    my( $class, $title) = @_;
    my( $win ) = $class->SUPER::new (      # create window with the super class
        undef, -1, $title, [-1,-1],[700, 500]
    );

    my %sizer;
    $sizer{'panel'} = Wx::BoxSizer->new(&Wx::wxHORIZONTAL);
    $sizer{'main'} = Wx::BoxSizer->new(&Wx::wxHORIZONTAL);
    $sizer{'leftcolumn'} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
    $sizer{'centercolumn'} = Wx::BoxSizer->new(&Wx::wxVERTICAL);
    $sizer{'rightcolumn'} = Wx::BoxSizer->new(&Wx::wxVERTICAL);

    require Kephra::App::TabBar;
    my $nb = Kephra::App::TabBar->new($win);

    $sizer{'main'}->Add($sizer{'centercolumn'}, 1, &Wx::wxGROW);
    $sizer{'centercolumn'}->Add($nb, 1, &Wx::wxGROW);

    my $panel = Wx::Panel->new( $this );
    $sizer{'panel'}->Add( $panel, 1, &Wx::wxGROW );
    $panel->SetSizer( $sizer{'main'});
    $win->SetSizer( $sizer{'panel'});

    #Wx::Event::EVT_CLOSE($frame, sub{$frame->Close; $_[1]->Skip });

    return $win;
}


1;