Folks-
I was wondering if anybody in ptk-land could
help out with this problem. I've posted it
to the POE mailing list, and got corroboration,
but nobody knows what the problem is or how
to fix it.
Apart from this problem, does anybody here
use POE? Do you like it?
Is there something better/different I should try?
Thanks
-Craig
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use POE;
POE::Session->create
( inline_states =>
{ _start => \&ui_start,
ev_count => sub { $_[HEAP]->{counter}++; },
ev_clear => sub { $_[HEAP]->{counter} = 0; },
}
);
$poe_kernel->run();
exit 0;
sub ui_start {
my ( $kernel, $session, $heap ) = @_[ KERNEL, SESSION, HEAP ];
$poe_main_window->Label( -text => "Counter" )->pack;
$heap->{counter} = 0;
$heap->{counter_widget} =
$poe_main_window->Label( -textvariable => \$heap->{counter} )->pack;
$poe_main_window->Button
( -text => "Count",
-command => $session->postback("ev_count")
)->pack;
$poe_main_window->Button
( -text => "Clear",
-command => $session->postback("ev_clear")
)->pack;
}
|