############################################################################### ## Trivial graphical interface to the 'File decimater' # # Allows you to select a file using a graphical user interface. # Requires the commandline 'dcmate' script in the same directory # # Author: L. Hollevoet ############################################################################### #!/usr/bin/perl -w use Tk; use strict; my($main) = MainWindow->new; my($Horiz) = 1; my($fname); my $resample = 15; my $label = $main->Label(-text => 'Select file first')->pack; my $ent = $main->Entry(-width => 8, -background => 'white', -textvariable => \$resample )->pack; $main->Button(-text => 'Process', -command => sub{&process()} )->pack; my @types = (["Log Files", '.log', 'TEXT'], ["All Files", "*"] ); my $file = $main->getOpenFile(-filetypes => \@types, -initialfile=> 'Default', -defaultextension => '.log'); print "File selected: $file"; $label->configure(-text => $file); MainLoop; print "Exit Stage right!\n"; exit; sub process(){ print "Processing file $file, $resample\n"; qx( perl dcmate.pl $file $resample ); exit; }