Hello, I have got a button that calls out a subroutine, which in turn invokes another process...this another process is a command line command and it generates output to STDOUT. My objective is to turn my "frame" into a text widget as soon as the button is pressed so that in the text widget I can display the output of the command line command (another process). The problem is that the button stays depressed until the command line command process is complete and the text widget is displayed with the output WHEN the process is complete - not what I want. I want the output to be displayed WHILE the process is work in progress...any ideas how to accomplish this? I have tried open() as shown in code below but didn't help. Also tried backticks and didn't work either...any ideas are appreciated. Code is below. Sub create_copy_project_command just formulates the command line command and returns the string. Thanks!
# get rid of top_frame $top_frame->packForget(); # create and display text widget my $tw = $second_frame->Text()->pack(); my $first_line = "Copying project...please wait"; $tw->insert( 'end', $first_line ); my $final_copy_project_command = &create_copy_project_command; open( COPY_PROJ, "$final_copy_project_command|" ); while ( my $copy_proj_line = (<COPY_PROJ>) ) { $tw->insert( 'end', $copy_proj_line ); }

In reply to how to display output of a process in text widget in real time by perlnu

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.