Date: | Sat, 22 Oct 2005 03:48:20 -0400 |
To: | bug-poe [...] rt.cpan.org |
Subject: | sig( UIDESTROY => 'foo' ) does not work |
From: | "Justin Wood (Callek)" <callek [...] gmail.com> |
sig( UIDESTROY => 'foo' ); does not seem to fire 'foo' when using Tk.
I am using ActiveStatePerl build 813 (Windows XP)
Tk version 804.27.0.2 (from activestate ppm)
POE version 0.302 (from winnipeg [Location:
http://theoryx5.winnipeg.ca/ppms/] ppm)
Test Script follows ====== signs ;-)
I will ok this e-mail to be transmitted to anyone assumed to be able to
fix it. This includes mass-mailings of potential developers.
~Justin Wood (Callek)
=====================
#!/usr/bin/perl
use warnings;
use strict;
# Tk support is enabled if the Tk module is used before POE itself.
use Tk;
use POE;
# Create the session that will drive the user interface.
POE::Session->create
( inline_states =>
{ _start => \&ui_start,
ev_test_speed => \&TestSpeed,
Bastard => \&Amazing,
}
);
# Run the program until it is exited.
$poe_kernel->run();
exit 0;
sub TestSpeed {
print "Testing Speed\n";
}
sub Amazing {
print "Wheels Cancel\n";
}
sub ui_start {
my ( $kernel, $session, $heap ) = @_[ KERNEL, SESSION, HEAP ];
$kernel->sig( UIDESTROY => 'Bastard' );
$poe_main_window->Label( -text => "Counter" )->pack;
$poe_main_window->Button
( -text => "Checkout Branch",
-command => $session->postback( ev_test_speed => 9 )
)->pack;
}
1;
__END__