Commits

Herbert Breunung committed 103f917

more precise name for prototype thats just displays one stc instance twice but cant edit

Comments (0)

Files changed (3)

lib/doubled.pl

-use v5.12;
-use warnings;
-
-DoubleView->new->MainLoop;
-
-package DoubleView;
-use base qw(Wx::App);
-use Wx;
-use WX::STC;
-
-sub OnInit {
-	my $app   = shift;
-	my $win = Wx::Frame->new( undef, -1, 'Kephra DVD - Double View Demo of an STC - use Ctrl + Tab',[-1, -1],[600, 600]);
-	my $ed1 = Wx::StyledTextCtrl->new($win, -1, );
-	my $ed2 = Wx::StyledTextCtrl->new($win, -1, );
-
-
-	$ed2->SetDocPointer( $ed1->GetDocPointer() );
-	Wx::Window::SetFocus( $ed1 );
-
-	Wx::Event::EVT_KEY_DOWN ($ed1, sub {
-		my ($self, $event) = @_;
-		my $code = $event->GetUnicodeKey;
-		if($code == &Wx::WXK_TAB and $event->ControlDown){ Kephra::App::Focus::set($ed2) }
-		else {$event->Skip}
-	});
-	Wx::Event::EVT_KEY_DOWN ($ed2, sub {
-		my ($self, $event) = @_;
-		my $code = $event->GetUnicodeKey;
-		if($code == &Wx::WXK_TAB and $event->ControlDown){ Kephra::App::Focus::set($ed1) }
-		else {$event->Skip}
-	});
-
-	my $sizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL);
-	$sizer->Add($ed1, 1, &Wx::wxGROW);
-	$sizer->Add($ed2, 1, &Wx::wxGROW);
-	$win->SetSizer($sizer);
-
-	$win->Center();
-	$win->Show(1);
-	$app->SetTopWindow($win);
-	1;
-}
+use v5.12;
+use warnings;
+
+DoubleView->new->MainLoop;
+
+package DoubleView;
+use base qw(Wx::App);
+use Wx;
+use WX::STC;
+
+sub OnInit {
+	my $app   = shift;
+	my $win = Wx::Frame->new( undef, -1, 'Kephra DVD - Double View Demo of an STC - use Ctrl + Tab',[-1, -1],[600, 600]);
+	my $ed1 = Wx::StyledTextCtrl->new($win, -1, );
+	my $ed2 = Wx::StyledTextCtrl->new($win, -1, );
+
+
+	$ed2->SetDocPointer( $ed1->GetDocPointer() );
+	Wx::Window::SetFocus( $ed1 );
+
+	Wx::Event::EVT_KEY_DOWN ($ed1, sub {
+		my ($self, $event) = @_;
+		my $code = $event->GetUnicodeKey;
+		if($code == &Wx::WXK_TAB and $event->ControlDown){ Kephra::App::Focus::set($ed2) }
+		else {$event->Skip}
+	});
+	Wx::Event::EVT_KEY_DOWN ($ed2, sub {
+		my ($self, $event) = @_;
+		my $code = $event->GetUnicodeKey;
+		if($code == &Wx::WXK_TAB and $event->ControlDown){ Kephra::App::Focus::set($ed1) }
+		else {$event->Skip}
+	});
+
+	my $sizer = Wx::BoxSizer->new( &Wx::wxHORIZONTAL);
+	$sizer->Add($ed1, 1, &Wx::wxGROW);
+	$sizer->Add($ed2, 1, &Wx::wxGROW);
+	$win->SetSizer($sizer);
+
+	$win->Center();
+	$win->Show(1);
+	$app->SetTopWindow($win);
+	1;
+}
 			@_;
 		}, 
 		wanted => sub {
+			return unless -r $_;
 			if (-f $_ and substr($_, -9) eq 'Kephra.pm') {
 				#$File::Find::dir #$File::Find::name # $_
 		 		my $path = File::Spec->catdir( $RealBin, $File::Find::name );
 				$ed->AppendText( $File::Find::name . "\n");
 			}
 			#$ed->AppendText( $_ . "\n")
-	}, follow => 0, no_chdir => 1 }, '/Users/lichtkind');
+	}, follow => 0, no_chdir => 1 }, '/');
 
 	$frame->Show(1);
 	$app->SetTopWindow($frame);