Skip Menu |

This queue is for tickets about the Curses-Toolkit CPAN distribution.

Report information
The Basics
Id: 65559
Status: resolved
Priority: 0/
Queue: Curses-Toolkit

People
Owner: Nobody in particular
Requestors: coke [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.203
Fixed in: (no value)



Can't run the sample in the the perldoc; after adding "use POE::Component::Curses", I get the following error: Constant subroutine POE::Component::Curses::MainLoop::OBJECT redefined at /Users/coke/usr/lib/perl5/site_perl/5.12.0/darwin-2level/Params/Validate.pm line 22 Constant subroutine POE::Component::Curses::OBJECT redefined at /Users/coke/usr/lib/perl5/site_perl/5.12.0/POE/Component/Curses.pm line 23 followed by: 42063: Sessions were started, but POE::Kernel's run() method was never 42063: called to execute them. This usually happens because an error 42063: occurred before POE::Kernel->run() could be called. Please fix 42063: any errors above this notice, and be sure that POE::Kernel->run() 42063: is called. See documentation for POE::Kernel's run() method for 42063: another way to disable this warning. This is perl 5, version 12, subversion 0 (v5.12.0) built for darwin-2level I'll try a more recent perl.
Hi, Le Mar 08 Fév 2011 07:06:18, COKE a écrit : Show quoted text
> Can't run the sample in the the perldoc; after adding "use > POE::Component::Curses",
Ah yes, that's because I forgot to mention that you need to use the Curses::Toolkit::Widget::* you intend to use. If you add use Curses::Toolkit::Widget::Window use Curses::Toolkit::Widget::Button it should work better. I plan to add an option when "use" ing POE::Component::Curses to also use all the widgets, something like : use Curses::Toolkit::Widget qw(all) Show quoted text
> > I get the following error: > > Constant subroutine POE::Component::Curses::MainLoop::OBJECT redefined > at > /Users/coke/usr/lib/perl5/site_perl/5.12.0/darwin- > 2level/Params/Validate.pm line 22 > Constant subroutine POE::Component::Curses::OBJECT redefined at > /Users/coke/usr/lib/perl5/site_perl/5.12.0/POE/Component/Curses.pm > line 23
These are warnings that you can ignore. I'll fix them soon. Show quoted text
> > followed by: > > 42063: Sessions were started, but POE::Kernel's run() method was never > 42063: called to execute them. This usually happens because an error > 42063: occurred before POE::Kernel->run() could be called. Please fix > 42063: any errors above this notice, and be sure that POE::Kernel-
> >run()
> 42063: is called. See documentation for POE::Kernel's run() method > for > 42063: another way to disable this warning.
Yeah, so the real errors are output to STDOUT, which is hidden because of Curses. To be able to see them, I suggest you run your program with 2> some_file and look at some_file. Anyway, the issue here Try the attached file, it should work better
Subject: simple1.pl
#!/usr/bin/env perl use strict; use warnings; use FindBin qw( $Bin ); use lib "$Bin/../../lib"; use POE::Component::Curses; use Curses::Toolkit::Widget::Window; use Curses::Toolkit::Widget::Button; # spawn a root window my $root = POE::Component::Curses->spawn(); # adds some widget $root->add_window( my $window = Curses::Toolkit::Widget::Window ->new() ->set_name('main_window') ->add_widget( my $button = Curses::Toolkit::Widget::Button ->new_with_label('Click Me to quit') ->set_name('my_button') ->signal_connect(clicked => sub { exit(0); }) ) ->set_coordinates(x1 => 0, y1 => 0, x2 => '100%', y2 => '100%', ) ); # start main loop POE::Kernel->run();
Also, you should have a look at the 'examples' directory of the archive, it contains nice examples, including the programs I ran at FOSDEM, and the twitter client
On Tue Feb 08 07:36:32 2011, DAMS wrote: Show quoted text
> Also, you should have a look at the 'examples' directory of the > archive, it contains nice > examples, including the programs I ran at FOSDEM, and the twitter > client
Thanks, the demo works now, and I'll check out the examples.