Kephra / lib / Kephra / App.pm

use strict;
use warnings;

use Wx;
use Kephra::API;

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

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

sub OnInit {
	$_ref = shift;
	Kephra::Config::init();
	Kephra::CommandList::init();

	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 {
	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;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.