Your code has too much in it, for me to run. I need to get Linux::CDROM, setup a bunch of directories, run as root, etc. If you want answers to questions, make the simplest possible script that demonstrates the problem. That way people can run it, and easily see the glitch. Usually when you do this simplification, you will answer your own question. This script just has too much clutter for me to make sense out of.

I think my problem is in the fact that everytime new data is in the filehandle, the buffer is overwritten. Is there a way to append data to the end of the buffer as it comes in?

Well, you are overwriting it with set_text. You can make a global variable, that you append to

my $buftext =''; ..... $buftext .= $sysbuffer; $buffer->set_text($buftext); # or better.....insert at the end_iter $buffer->insert( $buffer->get_end_iter, $sysbuffer );

The end_mark and end_iter concepts are hard to get right, it's best to make a few simple examples for yourself to play with them.

Also, if you read the warning messages, you should change 'add' to 'add_with_viewport' at the lines specified; it will make the scrollbars work better.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re^2: Realtime update of a textbuffer from STDOUT/STDERR in Gtk2 by zentara
in thread Realtime update of a textbuffer from STDOUT/STDERR in Gtk2 by fang0654

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.