NAME

Curses::UI::AnyEvent - Sub-class of Curses::UI for AnyEvent

SYNOPSIS

 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();

DESCRIPTION

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.

You'll probably want to install some AnyEvent watchers before you call 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...

SEE ALSO

Curses-UI-AnyEvent github repo

Curses::UI

AnyEvent

Curses::UI::POE

AUTHOR

Doug Hoyte, <doug@hcsw.org>

COPYRIGHT & LICENSE

Copyright 2016 Doug Hoyte.

This module is licensed under the same terms as perl itself.