Tickit::Console::Tab(3pm) | User Contributed Perl Documentation | Tickit::Console::Tab(3pm) |
"Tickit::Console::Tab" - represent a single tab on a "Tickit::Console"
Objects in this class represent a single switchable tab within a Tickit::Console. They are not constructed directly, but instead are returned by the "add_tab" method of the underlying "Tickit::Console" object.
The following extra parameters may be passed to the constructor, or via the "add_tab" method on the "Tickit::Console" object:
sub { gmtime $_[0] }
to generate timestamps in UTC instead of using the local timezone.
$name = $tab->name $tab->set_name( $name )
Returns or sets the tab name text
$tab->append_line( $string, %opts )
Appends a line of text to the tab. $string may either be a plain perl string, or an instance of String::Tagged containing formatting tags, as specified by Tickit::Widget::Scroller. Options will be passed to the Tickit::Widget::Scroller::Item::Line used to contain the string.
Also recognises the following options:
$tab->prepend_line( $string, %opts )
As "append_line", but prepends it at the beginning of the scroller.
$tab->bind_key( $key, $code )
Installs a callback to invoke if the given key is pressed while this tab has focus, overwriting any previous callback for the same key. The code block is invoked as
$result = $code->( $tab, $key )
If $code is missing or "undef", any existing callback is removed.
This callback will be invoked before one defined on the console object itself, if present. If it returns a false value, then the one on the console will be invoked instead.
Paul Evans <leonerd@leonerd.org.uk>
2023-03-11 | perl v5.36.0 |