#!/usr/bin/perl -w use strict; use Tk; my $open; my $te; # Entry Window my $mw = new MainWindow; # The START button: my $button = $mw -> Button(-text => "Start",-command=>\&push_button)->pack(); MainLoop; sub push_button { my $mw = new MainWindow; $mw -> geometry ("1200x600"); # Menu bar $mw->configure(-menu => my $menubar = $mw->Menu, -background => 'white'); my $file = $menubar->cascade(-label => '~File'); my $edit = $menubar->cascade(-label => '~Edit'); my $help = $menubar->cascade(-label => '~Help'); $mw-> Button (-text =>'Open', -command =>\&open_file)->place(-x=>240, -y=>35); $mw-> Button (-text =>'Get Statistics', -command =>\&get_statistics)->place(-x=>320, -y=>35); $te = $mw->Scrolled('TextUndo')->place(-x=>240, -y=>70); MainLoop; } sub open_file { $open = $mw->getOpenFile( #-filetypes => $types_OPEN, -defaultextension => '.sff' ); $te->Load($open); } sub get_statistics { my $fastafile= $open; print STDERR "selected file: $fastafile\n"; }