Tickit...e::Tab(3pm)
π Tickit::Console::Tab β the manual page, but make it cute β¨
okay bestie, so this is Tickit::Console::Tab from the User Contributed Perl Documentation family, and she is the tab class. Let's get into it π«Ά
π NAME π
"Tickit::Console::Tab" β represent a single tab on a "Tickit::Console"
πΈ DESCRIPTION πΈ
okay so picture this: objects in this class are one single switchable tab inside a Tickit::Console. That's the whole vibe. One tab. Switchable. Iconic.
and here's the tea β you do not construct them yourself, bestie, no cap. They get returned to you by the add_tab method of the underlying "Tickit::Console" object. She comes to you, you don't go to her π
β¨ PARAMETERS β¨
these extra parameters can be passed to the constructor, or handed over via the add_tab method on the "Tickit::Console" object:
timestamp_format => STRING or String::Taggedβ if it's defined, every line gets prefixed with a timestamp, built by applying thePOSIX::strftimefunction to this string. and if you hand her a String::Tagged instance? she preserves all the formatting from it. obsessed fr fr π¦datestamp_format => STRING or String::Taggedβ if defined, then every time a line is added to the buffer, if it starts a new day since the previous message (because the format yields a different string), this message gets added to the scroller as well. new day, new stamp, she's keeping track πlocaltime => CODEβ if defined, gives you an alternative function to"CORE::localtime"for converting an epoch value into a timestamp. for example, you could set it to
sub { gmtime $_[0] }
to generate timestamps in UTC instead of using the local timezone. timezone freedom, periodt β
π METHODS π
π§ name
π§ set_name
$name = $tab->name;
$tab->set_name( $name );
returns or sets the tab name text. short, sweet, does exactly what it says on the tin π
π append_line
$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 get passed along to the Tickit::Widget::Scroller::Item::Line that's used to contain the string.
she also recognises these extra options, bestie:
time => NUMβ overrides the epochtime()value used to generate a timestamp for this linetimestamp_format => STRING or String::Taggedβ overrides the stored format for generating a timestamp stringdatestamp_format => STRING or String::Taggedβ overrides the stored format for generating a datestamp string
π¦ prepend_line
$tab->prepend_line( $string, %opts );
same as append_line, but she prepends it at the beginning of the scroller instead. front of the line energy, main character placement π
π₯ bind_key
$tab->bind_key( $key, $code );
installs a callback to invoke if the given key is pressed while this tab has focus β and it overwrites any previous callback for the same key, so heads up. the code block gets invoked like this:
$result = $code->( $tab, $key );
if $code is missing or undef, any existing callback is removed. bye bestie π
okay important detail: this callback gets invoked before one defined on the console object itself, if there is one. and if it returns a false value, then the one on the console gets invoked instead. so she's first in line, but she'll pass the mic if she has to π€
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β thank you king π
and that's the whole page, bestie π she's perl v5.36.0, dated 2024-01-01, and that's a wrap on Tickit...e::Tab(3pm) π«Άβ¨
π¦ where this page comes from
- debian trixie: libtickit-console-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtickit-console-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtickit-console-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-console-perl 0.12-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms