I hope this makes sense. What I am wanting is for $var to change in the Label widget as the program processes the while loop. Some other notes, the directories are large (>1000 files). To me, it seems the program is hung during the glob function. The only time the main window updates is when the while loop is complete. Thoughts? keep in mind..newbie here...so.. be nice with the criticism....use Tk; # TK Setup #Window Creation $main = MainWindow -> new(); #Create Main Window Object $main -> minsize(qw(500 250)); #Size window $main -> configure(-background => 'blue');#Set Background Color #add go button $button_1 = $main -> Button(-text => "GO", -padx => 25, -foreground => "white", -background => "green", -command => \&go)-> pack(-side => 'bottom', -anchor => + 's', expand => 'yes'); #Add main center frame $left_3 = $main -> Frame(-relief => 'groove', -borderwidth => 3, -background => 'blue')-> pack(-side => 'botto +m',-anchor => 'n', -fill => 'x'); #added buttons to the frames (removed for this) #add label to center frame $label_3 = $left_3 -> Label(-text => "Status", -background => 'blue', -relief => 'raised', -borderwidth => 3, -foreground => 'white')->pack(-fill => 'x', -anchor => + 'w', expand => 1); $text = $left_3->Label(-textvariable => \$var)->pack(-anchor => ‘w’); + MainLoop(); sub go { #freeze the selections for $i (1..6){$check_button[$i] -> configure(-state => 'disabled') +;} # get info from dictionary files while(($folder, $drive) = each %search_locations) { #get list of files in directory $var = "Looking in - $drive/DICT/SOURCE\n"; chdir "$drive/variable/DICT/SOURCE"; @file_list = glob ("*.dsf"); $var = “Num of files: $#file_list”; } }
In reply to Newbie with a TK question by hebes_99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |