Tickit::Console(3pm) | User Contributed Perl Documentation | Tickit::Console(3pm) |
"Tickit::Console" - build full-screen console-style applications
my $console = Tickit::Console->new; Tickit->new( root => $console )->run;
A "Tickit::Console" instance is a subclass of Tickit::Widget::VBox intended to help building a full-screen console-style application which presents the user with one or more scrollable text areas, selectable as tabs on a ribbon, with a text entry area at the bottom of the screen for entering commands or other data. As a Tickit::Widget subclass it can be added anywhere within a widget tree, though normally it would be used as the root widget for a Tickit instance.
$console = Tickit::Console->new( %args );
Returns a new instance of a "Tickit::Console". Takes the following named arguments:
$on_line->( $active_tab, $text );
$tab = $console->add_tab( %args );
Adds a new tab to the console, and returns a Tickit::Console::Tab object representing it.
Takes the following named arguments:
$tab_widget = $make_widget->( $scroller );
Any other named arguments are passed to the tab's constructor.
$index = $console->active_tab_index;
$tab = $console->active_tab;
$console->remove_tab( $tab_or_index );
$console->move_tab( $tab_or_index, $delta );
$console->activate_tab( $tab_or_index );
$console->next_tab;
$console->prev_tab;
These methods are all passed through to the underlying Tickit::Widget::Tabbed object.
$console->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->( $console, $key );
If $code is missing or "undef", any existing callback is removed.
Paul Evans <leonerd@leonerd.org.uk>
2024-01-01 | perl v5.36.0 |