POE/Gtk2/POE::Loop::Glib don't bring up the GUI?

[email protected] (Mike Schilli) Sun, 26 Sep 2010 09:56:00 -0700 (PDT)
Newsgroups perl.poe
Message-ID <alpine.LRH.1.00.1009260936110.4161@pyramidlake.greatamerica.corp.yahoo.com>
Looks like POE stopped working with Gtk2 GUIs with Gtk2-1.222, POE-1.293, 
and POE-Loop-Glib-0.038. I'm not sure which one of the three caused it, but 
somehow the event loop fails to bring up the GUI on the screen, although 
the POE events get processed correctly. The following code's "ping" state 
gets triggered periodically, so POE works fine, it's just that the GUI
doesn't come up:

     use strict;
     use POE;
     use Gtk2 -init;

     POE::Session->create(
       inline_states => {
 	_start   => \&ui_start,
 	ping     => sub {
 	    print "ping\n";
 	    $poe_kernel->delay('ping', 1);
 	}
     });

     sub ui_start {

       my $window = Gtk2::Window->new ('toplevel');
       my $button = Gtk2::Button->new ('Quit');
       $button->signal_connect (clicked => sub { Gtk2->main_quit });
       $window->add ($button);
       $window->show_all;
       $poe_kernel->delay('ping', 1);
     }

     $poe_kernel->run();

On the other hand, a simple Gtk2 program works fine and a pops up a window:

     use strict;
     use Gtk2 -init;
     my $window = Gtk2::Window->new ('toplevel');
     my $button = Gtk2::Button->new ('Quit');
     $button->signal_connect (clicked => sub { Gtk2->main_quit });
     $window->add ($button);
     $window->show_all;
     Gtk2->main;

Anything I missed in the first snippet? Or are there any known issues with 
Gtk2-1.222, POE-1.293, and POE-Loop-Glib-0.038? Any help appreciated.

-- Mike

Mike Schilli
[email protected]