The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tickit - Terminal Interface Construction KIT

SYNOPSIS

 use Tickit;

 my $tickit = Tickit->new;

 # Create some widgets
 # ...

 $tickit->set_root_widget( $rootwidget );

 $tickit->run;

DESCRIPTION

This DEVELOPMENT version of Tickit bundles a snapshot copy of the libtickit C library, and builds and links against it. It exists largely as an experiment over the (mostly) pure-perl stable release version of Tickit. Unless you specifically want to test the C library or XS wrapping, you should instead stick to the stable release version at present.

CONSTRUCTOR

$tickit = Tickit->new( %args )

Constructs a new Tickit framework container object.

Takes the following named arguments at construction time:

term_in => IO

IO handle for terminal input. Will default to STDIN.

term_out => IO

IO handle for terminal output. Will default to STDOUT.

UTF8 => BOOL

If defined, overrides locale detection to enable or disable UTF-8 mode. If not defined then this will be detected from the locale by using Perl's ${^UTF8LOCALE} variable.

METHODS

$tickit->later( $code )

Runs the given CODE reference at some time soon in the future. It will not be invoked yet, but will be invoked at some point before the next round of input events are processed.

$term = $tickit->term

Returns the underlying Tickit::Term object.

$cols = $tickit->cols

$lines = $tickit->lines

Query the current size of the terminal. Will be cached and updated on receipt of SIGWINCH signals.

$tickit->bind_key( $key, $code )

Installs a callback to invoke if the given key is pressed, overwriting any previous callback for the same key. The code block is invoked as

 $code->( $tickit, $key )

If $code is missing or undef, any existing callback is removed.

As a convenience for the common application use case, the Ctrl-C key is bound to the _STOP method.

To remove this binding, simply bind another callback, or remove the binding entirely by setting undef.

$tickit->rootwin

Returns the root Tickit::Window.

$tickit->set_root_widget( $widget )

Sets the root widget for the application's display. This must be a subclass of Tickit::Widget.

$tickit->setup_term

Set up the screen and generally prepare to start running

$tickit->teardown_term

Shut down the screen after running

$tickit->tick

Run a single round of IO events. Does not call setup_term or teardown_term.

$tickit->run

Calls the setup_term method, then processes IO events until stopped, by the _STOP method, SIGINT, SIGTERM or the Ctrl-C key. Then runs the teardown_term method, and returns.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>