#!/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::Pane;
# Zuerst wieder ein Hauptfenster und zwei Frames:
my $mw = MainWindow->new(-title => "CheBa 0.001 beta");
my $frame = $mw->Frame(-height =>500,
-width =>600,
);
my $frame2 = $mw->Frame();
my $eingabe="";
# Menubuttons
my $m_file = $frame2->Button(-text => "Datei holen",
-underline => 0,
-command => [\&get, "get"],
);
my $m_opti = $frame2->Button(-text => "Alte Datei",
-underline => 0,
-command => [\&show, "show"],
);
my $m_help = $frame2->Button(-text => "Hilfe",
-underline => 0,
-command => [\&help, "help"],
);
####################################
####################################
### Hier beginnt das Drama : )
####################################
####################################
my $pane = $frame->Scrolled("Label",
-scrollbars => 'oe',
-textvariable => \$eingabe,
-height => 20,
-width =>50,
-anchor => 'nw',
-background => "yellow",
-relief => "ridge",
-borderwidth => 2,
-padx => '2m',
-pady => '2m',
);
# Jetzt packen wir wieder alles zusammen:
$m_file->pack(-side => 'left',
-expand => 0,
-fill => 'x',
);
$m_opti->pack(-side => 'left',
-expand => 0,
-fill => 'none',
);
$m_help->pack(-side => 'left',
-expand => 0,
-fill => 'none',
);
$frame2->pack(-side => 'top',
-expand => 0,
-fill => 'x',
);
$pane->pack(-side => 'top',);
$frame-> pack(-side => 'top',
-expand => 1,
-fill => 'both',
);
# Der Exit Button:
my $fbut = $mw->Frame()->pack();
my $bxit = $fbut->Button(-text => 'Exit',
-command => [$mw => 'destroy'],
)
->pack(-side => 'left',
-expand => 0,
-fill => 'none',
);
MainLoop();
sub get {
} # sub file
sub show {
open(ACCESION_START, "</home/Sebastian/bioinf/scripte/bioperl/accessions_start") || die "konnte accessions_start Liste nicht öffnen\n";
while(<ACCESION_START>){
my $new_acc=substr($_,0,9);
$eingabe.=$new_acc."\n";
}
} # sub file
sub help {
$eingabe="Mit diesem Tool wird die\n....";
} # sub file