Curses::UI::AnyEvent - Sub-class of Curses::UI for AnyEvent
use strict; use Curses::UI::AnyEvent; my $cui = Curses::UI::AnyEvent->new(-color_support => 1); $cui->set_binding(sub { exit }, "\cC"); $cui->set_binding(sub { $cui->mainloopExit() }, "q"); my $win = $cui->add('win', 'Window', -border => 1, -bfg => 'red', ); my $textviewer = $win->add('mytextviewer', 'TextViewer', -text => '', ); my $watcher = AE::timer 1, 1, sub { $textviewer->{-text} = localtime() . "\n" . $textviewer->{-text}; $textviewer->draw; }; $textviewer->focus(); $cui->mainloop();
Very simple integration with Curses::UI and AnyEvent. Just create a Curses::UI::AnyEvent object instead of a Curses::UI one and use it as normal.
Curses::UI::AnyEvent
Curses::UI
You'll probably want to install some AnyEvent watchers before you call mainloop().
mainloop()
Seems to work well but there is probably some stuff missing. I haven't tested mouse integration yet for example. Curses::UI::POE seems to do a lot more stuff for some reason...
Curses-UI-AnyEvent github repo
AnyEvent
Curses::UI::POE
Doug Hoyte, <doug@hcsw.org>
<doug@hcsw.org>
Copyright 2016 Doug Hoyte.
This module is licensed under the same terms as perl itself.
To install Curses::UI::AnyEvent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Curses::UI::AnyEvent
CPAN shell
perl -MCPAN -e shell install Curses::UI::AnyEvent
For more information on module installation, please visit the detailed CPAN module installation guide.