Layout...ompass(3pm)
๐ Layout::Manager::Compass ๐
okay bestie, so this is the Layout::Manager::Compass page from the User Contributed Perl Documentation, section 3pm, and it's literally a compass-based layout manager and I'm obsessed. ๐งญโจ
๐ NAME ๐
Layout::Manager::Compass โ a compass based layout, no cap. ๐งญ๐
โจ DESCRIPTION โจ
So Layout::Manager::Compass is a layout manager that takes hints based on the four cardinal directions โ north, east, south and west โ plus a center area that takes up all the remaining space, heightwise. ๐ซถ
In other words (fr fr): the center area will expand to take up all the space that is NOT used by components placed at the edges. And components at the north and south edges will take up the full width of the container. main character behavior honestly. ๐
+--------------------------------+
| north |
+-----+--------------------+-----+
| | | |
| w | | e |
| e | center | a |
| s | | s |
| t | | t |
| | | |
+-----+--------------------+-----+
| south |
+--------------------------------+
Components are placed in the order they are added. So if two items are added to the 'north' position, then the first item will be rendered above the second. And the height of the north edge will equal the height of both components combined. math is mathing. ๐งฎโจ
Items in the center split the available space, heightwise. Two center components will each take up 50% of the available height and 100% of the available width. fifty fifty, periodt. ๐
Compass is basically an implementation of Java's BorderLayout โ if you wanna peek at it: <http://java.sun.com/docs/books/tutorial/uiswing/layout/border.html> ๐ฆ
๐ธ SYNOPSIS ๐ธ
$cont->add_component($comp1, 'north');
$cont->add_component($comp2, 'east');
my $lm = Layout::Manager::Compass->new;
$lm->do_layout($cont);
๐ POSITIONING ๐
When you add a component with add_component, the second argument should be one of: north, south, east, west or center. Case doesn't matter bestie, she's flexible like that. ๐ You can also just provide the first letter of the word and it will do the same thing. one letter and she understands you, that's real chemistry. ๐
๐ METHODS ๐
do_layout
Size and position the components in this layout. that's it, that's the job. ๐ซก
๐ AUTHOR ๐
Cory Watson, "<gphat@cpan.org>" ๐
๐ COPYRIGHT & LICENSE ๐
Copyright 2008 - 2010 Cory G Watson
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (yes it's the standard Perl license situation, we love a classic ๐)
okay that's the whole page!! and for the cute sign-off: this was perl v5.34.0, dated 2022-06-15, and the footer said Layout...ompass(3pm) because the title got truncated by the terminal and honestly? iconic. ๐โจ bye bestie, go lay out some components ๐๐ฆ
๐ฆ 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