Hello,
I wrote a PERL TK program that creates 3 Labels with text variables inside frames. A snippet is below. I use other frames for other things.
my $red;
my $green;
my $blue;
my $mw = MainWindow->new;
$mw->title();
my $right_frame = $mw->Label->pack();
my $variable_frame = $right_frame->Label->pack();
my $red_frame = $variable_frame->Label(-textvariable =>\$red)->pack();
my $green_frame = $variable_frame->Label(-textvariable => \$green)->pa
+ck();
my $blue_frame = $variable_frame->Label(-textvariable => \$blue)->pack
+();
$variable_frame->Label(-text =>"------")->pack();
I removed what was inside pack();, so the code was single lined.
I then proceed to scan a file and update the variables red, green, and blue. When updating the frame.
$red_frame->update;
$greeen_frame->update;
$blue_frame->update;
The last updated variable shows up, but the previously updated ones disappear. So from the code above blue would be visible but red and green labels would be blank, in the GUI. How can I have all variables showing in the GUI?
Some psuedo code:
Create GUI
LOOP
scan new document
find $red
update gui
find $green
update gui
$find $blue
update gui
END Loop
I would like my variables updating as soon as the change and not wait till they're all found at the end to update in the GUI. The last Label as well containing no textvariable just a string "------" goes blank when the loop resets.