Source

Kephra / lib / Kephra / App.pm

use strict;
use warnings;

use Wx;
use Kephra::API;

package Kephra::App;
our @ISA = 'Wx::App';
our $_ref;

Kephra::API::Command::register({
 'app-close-save'=> {sub => '$app->close_save', label=> 'Exit', keys=> 'alt+q'},
});

sub OnInit {
	$_ref = shift;

	my $win = Kephra::App::Window->new(__PACKAGE__);

	Kephra::File::new();

	$win->Center();
	$win->Refresh();   # remove visual clutter on start
	$win->Show();

	1;
}

sub close_save {
	Kephra::File::close_all();
	close_raw();
}

sub close_raw  {
	my $win = Kephra::API::main_window();
	$win->destroy();
}

sub OnExit {
	my $app = shift;
	Wx::wxTheClipboard->Flush;
	1;
}

# $app->ExitMainLoop(1);
1;