in reply to Creating new ptk windows with POE?

I'm not familiar with POE, but from reading your post, it seems you want to create multiple Tk MainWindows. The MainWindow is associated with the Tk eventloop, so POE may be getting confused as to which Tk-eventloop it controls.. I would try creating 1 MainWindow, then create additional Tk windows as Toplevels instead of MainWindows. I just grabbed this POE-Tk file-tail code (by Jack D) to demonstrate. I added a Create Toplevel Button.
#!/usr/bin/perl use warnings; use strict; # Tk support is enabled if the Tk module is used before POE itself. use Tk; use Tk::ROText; use POE; use POE::Wheel::FollowTail; my $FILENAME = "z"; open (TAIL,">$FILENAME") or die; select(TAIL); my $ID; my $tl; POE::Session->create ( inline_states => { _start => \&ui_start, gotline => \&ui_read, ev_clear => \&ui_clear, writeline => \&ui_write, stopwrite => \&ui_stop, } ); $poe_kernel->run(); exit 0; sub ui_start { my ( $kernel, $session, $heap ) = @_[ KERNEL, SESSION, HEAP ]; $heap->{text_widget} = $poe_main_window->Scrolled('ROText',-scrollbars=>'ose' )->pack; $poe_main_window->Button ( -text => "Write to File", -command => $session->postback("writeline") )->pack; $poe_main_window->Button ( -text => "New Toplevel", -command => sub {my $tl = $poe_main_window->Toplevel(); $tl->geometry('300x100+100+100'); $tl->title( "Toplevel" ); } )->pack; $poe_main_window->Button ( -text => "Stop Writing to File", -command => $session->postback("stopwrite") )->pack; $poe_main_window->Button ( -text => "Clear Widget", -command => $session->postback("ev_clear") )->pack; $heap->{tail} = POE::Wheel::FollowTail->new ( Filename => $FILENAME, InputEvent => 'gotline'); } sub ui_read { $_[HEAP]->{text_widget}->insert('end',$_[ARG0]); $_[HEAP]->{text_widget}->insert('end',"\n"); $_[HEAP]->{text_widget}->see('end'); } sub ui_clear { $_[HEAP]->{text_widget}->delete('1.0','end'); } sub ui_write { $ID->cancel if ($ID); $|=1; $ID = $_[HEAP]->{text_widget}->repeat(1000,sub { print TAIL scalar gmtime,"\n"}); } sub ui_stop { return unless ($ID); $ID->cancel if ($ID); $ID = undef; $_[HEAP]->{text_widget}->insert('end',"Writing stopped....!!!!!\n\ +n"); } ######################################

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