NAME Tickit::Widget::Term - a widget containing a virtual terminal SYNOPSIS use Tickit; use Tickit::Widget::Term; my $tickit = Tickit->new( root => my $term = Tickit::Widget::Term->new, ); $term->set_on_output( sub { my ( $bytes ) = @_; ## some application logic here to handle the bytes }); ## some application logic here to invoke $term->write_input $tickit->run; DESCRIPTION This widget class uses Term::VTerm to provide a virtual terminal, receiving bytes containing terminal sequences which are used to draw the content to the screen. Typically this would be used connected to some external process via a PTY device. Currently, this class does not provide management of that, so the application will have to perform this bytewise IO itself, via the "write_input" method and "set_on_output" event handler. METHODS write_input $term->write_input( $bytes ) Push more bytes into the terminal state. on_output set_on_output $on_output = $term->on_output $term->set_on_output( $on_output ) $on_output->( $bytes ) Accessors for the on_output event callback, which is invoked by the terminal engine when more bytes of response have been generated. Typically this is caused by keyboard or mouse events, but it can also be generated in response to some received query sequences. flush $term->flush Finishes a round of screen update events, ensuring that any pending screen damage is handled. Also flushes the output buffer, invoking the on_event handler if required. on_resize set_on_resize $on_resize = $term->on_resize $term->set_on_resize( $on_resize ) $on_resize->( $lines, $cols ) Accessors for the on_resize event callback, which is invoked after a resize of the displayed widget. This may be required to inform the appliction driving the terminal of its new output size. AUTHOR Paul Evans