The problem is that your POE::Session instance is only doing one POEy thing: tailing that file. When it stops, POE recognizes that nothing POEy is happening and stops the seesion for inactivity.
The program needs a way to say: I'm getting events from Tk, so I'll stick around as long as the user interface is present.
POE has this, through POE::Session's postback() method. Postbacks are anonymous subroutines that, when called, post events. They also have a side effect: as long as they exist, the target session will remain alive.
Try this:
When that button is pressed, Tk will send a "sendStop" to the "myClient" session. If it works, you can discard the stop() function.my $client_session = $_[KERNEL]->alias_resolve("myClient"); $top->Button( -text =>"Stop", -command => $client_session->postback("sendStop"), )->pack(-side=>'bottom');
The unresponsiveness happens because POE::Wheel::FollowTail has already read the entire file and generated events for each line. Your button press is enqueued at the end of all that.
You'll either have to wait it out, or not seek so far from the end of the file.
In reply to Re: Confusion with POE & pTk
by rcaputo
in thread Confusion with POE & pTk
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |