hebes_99 has asked for the wisdom of the Perl Monks concerning the following question:
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”; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Newbie with a TK question
by g0n (Priest) on Jan 25, 2006 at 19:29 UTC | |
by hebes_99 (Acolyte) on Jan 25, 2006 at 19:35 UTC | |
|
Re: Newbie with a TK question
by thundergnat (Deacon) on Jan 25, 2006 at 19:41 UTC | |
|
Re: Newbie with a TK question
by zentara (Cardinal) on Jan 25, 2006 at 19:49 UTC |