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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|