Well, given the practicalities involved with this project, I've made an executive decision(!)...

I'll use the idea that has been suggested of updating a progress bar on a pop-up window... and just get it to run a 'resonable time' (which I'll determine by a few test runs), after which I'll check if the file I'm expecting to see has been created. If it's not there or some other error occurs, I'll deal with that AFTER the 'Working' pop-up has gone.

As this program I'm building is just a 'make-do' thing until some other people fix-up the problems we've reported in their software, what I've described will probably be sufficient; it doesn't have to be 'perfect'(!)... and it certainly doesn't justify all the development/debugging required for IPC/process communications.

Many thanks for all your assistance, folks... I appreciate it a lot.

BTW... The final sample code I'll further massage follows:

use strict; use Tk; use Tk::ProgressBar; # WHY is this required, given the prior line? # If it's not included I get warnings!? my $MAXTIME = 10; my $mw = MainWindow->new; # Main window my $top = $mw->Frame( -background => '#239867', -borderwidth => 2, )->pack(-fill => 'both'); my $lbltxt = $top->Label( -text => 'Just some text', -background => 'white', )->pack(-side => 'right', -padx => 10); my $GoBtn = $top->Button( -text => ' Pop It! ', -command => \&AddItemNew )->pack(-side => 'left', -padx => 10, -pady => 5); my $DoneBtn = $top->Button( -text => ' Exit ', -command => \&Cleanup )->pack(-side => 'right', -padx => 10, -pady => 5); $mw->focus; # Ensure we're talking to the main window MainLoop; # Run the program, watching for events # ---- sub Cleanup { $mw->destroy; } # ---- sub AddItem { my $tp = $mw->Toplevel( -title => ' AddItem' ); # ->pack(-fill => 'both'); my $tpfrm = $tp->Frame( -background => '#22cc00', )->pack(-side => 'top', -fill => 'x'); my $tplbl = $tpfrm->Label( -text => 'Working...', -background => 'white', -foreground => 'black' )->pack(-side => 'top', -padx => 10); my $tpbtn = $tpfrm->Button( -text => 'Close', -command => [$tp => 'destroy'], )->pack(-side => 'top', -padx => 10, -pady => 5); } # ---- sub AddItemNew { my $tp = $mw->Toplevel( -title => ' AddItem' ); # ->pack(-fill => 'both'); my $tpfrm = $tp->Frame( -background => '#22cc00', )->pack(-side => 'top', -fill => 'x'); my $tplbl = $tpfrm->Label( -text => 'Working...', -background => 'white', -foreground => 'black' )->pack(-side => 'top', -padx => 10); $GoBtn->configure(-state => "disabled"); my $progress = $tpfrm->ProgressBar( -width => 20, -length => 100, -anchor => 'w', -state => 'disabled', -value => 0, -from => 0, -to => $MAXTIME-1, -blocks => 1, -colors => [0, 'blue'] )->pack(); for (0..$MAXTIME-1) { $progress->value($_); $progress->update(); sleep 1; } $tp->withdraw; $GoBtn->configure(-state => "normal"); }

In reply to Re^2: How to PopUp a 'Status' window in Perl/Tk by ozboomer
in thread How to PopUp a 'Status' window in Perl/Tk by ozboomer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.