Typically for a long procedural sequence in Tk, I farm the procedural step out to a subroutine, usually with a go button. The subroutine can then loop through all the steps I want done without the need to return to the GUI event model. The GUI can be updated periodically from the subroutine (pass mainwindow in to the subroutine as a parameter) in a couple of different ways.
If shelling out to command line, I often just capture the output with qx or backticks and post that capture back to the mainwindow. This has the drawback that the GUI will not be updated until the command completes. This hasn't been a problem for me since most of my GUI apps also involve counters of some kind. Updating those prevents the user from wondering if the screen has frozen.
If you want to pipe the output of tar to a textbox, you could map STDIN to the text box. I haven't done this yet, just read about it (
Mastering Perl/Tk I think) but I keep looking for a chance to use it.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.