Hi Monks,

I have written a code where I am executing a push button in perl TK.

I am copying a part of the code which I am having problem here. Here I have used a push button in the GUI and once I push the button in the GUI, it calls the sub-block push_button. I want to first print Execution in progress and then execute the code in the entireCode() function and then ask the user to check the FinalOut.txt file for results. Note that the entireCode sub-block takes about 15 minutes to run

sub push_button { $gdsname = $ent->get(); $gdsname ||= '?'; $txt->insert( 'end', "Execution in progress\n" ); entireCode(); $txt->insert( 'end', "Operation is successful. Check FinalOut.txt for +results.\n" ); }

But when I run the code, the entireCode sub-block runs. Then after 15 mins, In the text box I see

Execution in progress

Operation is successful. Check FinalOut.txt for results.

I want to first print out the execution in progress and then run the background task and once the background task ( entireCode function) is complete, print "operation successful. check FinalOut.txt"

Is there a way to do this? Or what might I be doing wrong? Can I somehow make the text be printed out in real time?

thanks,

In reply to Perl Tk: Push button execution issue. by Ganesh Bharadwaj1

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.