Tickit...::HBox(3pm)
π Tickit::Widget::HBox β the horizontal-row glow-up π
okay bestie, so this page is from the User Contributed Perl Documentation collection, and it's all about Tickit::Widget::HBox β the widget that lines your babies up side by side like a little row of besties linking arms π«Ά
β¨ NAME β¨
Tickit::Widget::HBox β distribute child widgets in a horizontal row π
β¨ SYNOPSIS β¨
use Tickit;
use Tickit::Widget::HBox;
use Tickit::Widget::Static;
my $hbox = Tickit::Widget::HBox->new;
foreach my $position (qw( left centre right )) {
$hbox->add(
Tickit::Widget::Static->new(
text => $position,
align => $position,
valign => "middle",
),
expand => 1
);
}
Tickit->new( root => $hbox )->run;
like, look at that. three little statics, all chill, all in a row, all expand => 1. the alignment is literally doing the most and we love that for them π
β¨ DESCRIPTION β¨
So Tickit::Widget::HBox is a subclass of Tickit::Widget::LinearBox, and its whole personality is: put the children in a horizontal row. That's it. That's the vibe.
Its height will be the height of the tallest child (iconic β the tall one sets the standard, no cap). Its width will be the sum of the widths of all the children, plus the inter-child spacing.
And then β okay this is the cute part β optionally, if you give it a non-zero spacing between child widgets and a style to draw in, a vertical dividing line gets drawn between each child. A little fence between your friends. Aesthetic. β¨
π STYLE π
The default style pen is used as the widget pen, periodt. The following style pen prefixes are also used:
line => PENβ the pen used to render a dividing line between child widgets. ποΈ (Since version 0.52.)
β οΈ Heads up bestie: the widget pen is mutable, and changes to it will result in immediate redrawing β but any changes you made will be LOST if the widget style is changed. gone. poof. π so don't get attached.
The following style keys are used:
spacing => INTβ the number of columns of spacing between children πline_style => INTβ (Since version 0.52.) if set, the style to draw a dividing line between each child widget. Must be one of theLINE_*constants fromTickit::RenderBuffer. no freelancing, it has to be one of those β
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β thank you king π«Ά
okay that's the whole page, you're fully caught up, go build your little row of widgets and slay π
this was brought to you by perl v5.40.0, dated 2024-09-16, living under the name Tickit...::HBox(3pm) in the User Contributed Perl Documentation β mwah, bye bestie π¦πΈ
π¦ where this page comes from
- ubuntu resolute: libtickit-widgets-perl 0.42-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtickit-widgets-perl 0.42-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