#!/usr/bin/perl use Tk; use threads; my @packetnumber; my @hostname; my %pack_status; my $mw = new MainWindow(); my $mframe = $mw->Frame(); my $textfield_listing = $mframe->ScrlListbox(-scrollbars =>"se"); my $button_log = $mframe->Button(-command=>\&viewLog); sub viewLog() { if ($textfield_listing->curselection()) { # make a new Thread for the editor-application my $editor = threads->create("openLogWEA"); } } sub openLogWEA() { # get logfile-location my @tempvar = $textfield_listing->curselection(); my $pos = $tempvar[0]; my $location = "./Logfiles/Log_pack_$packetnumber[$pos].txt"; system("kate $location"); }