A single session should work. Per your question on POE's mailing list, you can run POE::Wheel::FollowTail instances in the same session that updates your GUI.

If Tk fileevents are higher priority than GUI updates, then the code to read the file will pre-empt the GUI updates. Disk files always report ready-to-read, which is why file tailing often uses other things.

POE::Wheel::FollowTail is better for this if you expect the file to grow later, or if you want to tail a named pipe.

sleep() will prevent both Tk and POE from doing anything. Avoid it if possible. POE::Kernel provides a delay() method that can be used instead and won't stop the whole program.

POE::Kernel also provides a select_read() method that works a bit like Tk's fileevent, except that it's portable. If you switch to Gtk later, select_read() should continue to work. Any code using Tk::Fileevent directly would need to be rewritten. Tk and Gtk are not your only options. See the CPAN for additional POE::Loop modules.

No idea why Tk scrolling is slow. It could be a number of things.

The update() call is necessary if fileevents are higher priority than GUI update events. update() tells Tk to refresh the display at times when it normally wouldn't. It's not the perfect solution, though. For example, it may not allow you to actually do anything until the fileevents stop firing.

I'm going to dismiss your question on POE's mailing list because you've also asked it here. You should probably ping me in irc.perl.org #poe (or on the mailing list) when you have more information or questions. While PerlMonks' RSS feed notifies about new articles, it's not so good at telling me when someone's replied to them. I don't camp out here refreshing the page, so I may not notice the continuation of this thread for days. If I'm doing PerlMonks wrong, and there's a better way to keep tabs on things, please let me know.


In reply to Re: POE/Tk/Fileevent Strangeness by rcaputo
in thread POE/Tk/Fileevent Strangeness by cmv

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.