Hi monks, I have a main window update question. I have a simple but long script that runs as a subroutine when the user makes some selections in the main window. I'm having an update issue with the progress bar. I tried using fork by I got an error due to an line using SMTP in the subroutine. I'm thinking fork may not be he best solution and that I'm missing something. Here's a stripped down example of my code:
use strict; use warnings; #use Mozilla::CA; use Tkx; use Tcl::Tk; #set window geometry and options my $mw = Tkx::widget->new("."); $mw->g_wm_minsize(400, 500); $mw->g_wm_title(my $title); my $b; $b = $mw->new_button( -text => "Run", -command => \&run, #); #Tkx::after(500, sub { $mw->g_destroy }); #}, ); $b->g_pack( -padx => 10, -pady => 10, ); #Quit button my $b2; $b2 = $mw->new_button( -text => "Quit", -command => sub { $b2->m_configure( -text => "Quit", ); CORE::exit; Tkx::after(500, sub { $mw->g_destroy }); }, ); $b2->g_pack( -padx => 10, -pady => 10, ); #Table Output Tkx::package_require("Tktable"); $mw = Tkx::widget->new("."); my $t = $mw->new_table( -rows => 5, -cols => 3, ); $t->g_pack; #Progress Bar my $progress = "10"; my $overall_progress_bar = $mw->new_ttk__progressbar( -orient => "horizontal", -mode => "determinate", -length => "100", #-maximum => $file_count, #-value => $progress, -maximum => "400", -value => $progress, ); $overall_progress_bar->g_pack; Tkx::MainLoop(); exit; sub run { #First block of code #define links my $keywordsfile="keywords.txt"; ##a lot more happens here print "Test!!"; }
I've tried adding to the $progressbar value as well and using Tkx::update(); with no luck. Any guidance for this novice would be greatly appreciate. Another thing that I've seen that I'd like to fix is the main window, when I run on a PC, is unresponsive. I know it's all the same issue. Thank you
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |