Layout...r::Flow(3pm)
β¨ NAME β¨
Layout::Manager::Flow β a directional layout manager, bestie π it literally places your components in one of the four cardinal directions.
πΈ DESCRIPTION πΈ
So Layout::Manager::Flow is a layout manager that anchors components in one of the four cardinal directions. That's it, that's the whole vibe.
When you instantiate a Flow manager, you may supply it with an anchor value, which may be one of north, south, east or west. The example below shows how the default anchor value of north works when you add two components. No cap, it's giving organized.
north
+--------------------------------+
| component 1 |
+--------------------------------+
| component 2 |
+--------------------------------+
| |
| |
| |
+--------------------------------+
Components are placed in the order they are added. So if two items are added with a 'north' anchor, the first item will be rendered above the second β first come, first slays π. Components will be expanded to take up all space perpendicular to their anchor. North and south will expand widths while east and west will expand heights. iykyk.
Flow is similar to Java's FlowLayout, which lives over at http://java.sun.com/docs/books/tutorial/uiswing/layout/flow.html. It does not, however, center components π«Ά. This features may be added in the future if they are needed.
π¦ SYNOPSIS π¦
$cont->add_component($comp1);
$cont->add_component($comp2);
my $lm = Layout::Manager::Flow->new(anchor => 'north');
$lm->do_layout($cont);
π ATTRIBUTES π
anchor
The direction this manager is anchored. Valid values are north, south, east and west. Pick your main character direction, babes π.
used
Returns the amount of space used an arrayref in the form of [ $width, $height ]. So like, exactly how much room you took up π.
wrap
If set to a true value, then component will be 'wrapped' when they do not fit. This currently only works for East and West anchored layouts. Lowkey niche but it's there β¨.
π METHODS π
do_layout
Size and position the components in this layout. That's the whole job, and it does it flawlessly, periodt π₯.
π AUTHOR π
Cory Watson, "<gphat@cpan.org>" β the icon who made this, we stan π
.
π COPYRIGHT & LICENSE π
Copyright 2008 by Cory G Watson
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay bestie that's the whole page π¦ β this doc is from perl v5.34.0, dated 2022-06-15. go forth and anchor your components, you absolute legend πβ¨
π¦ where this page comes from
- debian bookworm: liblayout-manager-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liblayout-manager-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liblayout-manager-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liblayout-manager-perl 0.35-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblayout-manager-perl 0.35-2 Β· 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