Utils(3pm)
π Utils(3pm) β Lire::UI::Utils
okay so this is a page from LogReport's Lire Documentation, and it's literally all about Lire::UI::Utils β the little helper squad that handles UI management for you π«Ά
β¨ NAME β¨
Lire::UI::Utils β utility functions for UI management. that's it, that's the vibe π
πΈ SYNOPSIS πΈ
use Lire::UI::Utils;
bestie just drop that use line in and you're in business β¨
π DESCRIPTION π
utility functions for UI code, periodt. it's giving "small module, big main character energy" π
π
button_box_width( $buttons )
so this one computes the width required to draw the button box described by the 'buttons' parameter. plot twist: that parameter is a hash reference. yes, a hashref. noted. β¨
π¦ button_label( $label, $max_button_width )
returns a label suitable for a button, keeping in mind that the maximum width of said button is $max_button_width. it crops accordingly so nobody overflows, no cap π
π layout_buttonbox( $container, $box, [ $padleft ], [ $padright ] )
the big one, honestly π₯ this crops the labels of the Curses::UI::Buttonbox $box until it fits in the canvaswidth() of the $container. $padleft and $padright are optional and you can use them to allow space for padding π
it also sets the '-width' and '-x' attributes of the Buttonbox. in the worst case, labels get reduced to their first letter π (it's giving survival mode).
real talk: the Buttonbox's buttons should have their'-label'attribute set to the full label without any button decorations (like'[') β the function adds those itself after cropping. don't pre-decorate, iykyk π
π SEE ALSO π
Lire::UI(3pm)β go read that one too, bestie π«Ά
β VERSION β
$Id: Utils.pm,v 1.7 2006/07/23 13:16:32 vanbaal Exp $
π AUTHORS π
Wolfgang Sourdeau <wolfgang@logreport.org> π
π COPYRIGHT π
Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
that's the whole page, bestie π slay, go forth and lay out some button boxes π
signed off with love β Lire 2.1.1, dated 2025-09-28 β¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms