Lire::UI::Utils(3) Utility functions for UI management


use Lire::UI::Utils;


Utility functions for UI code.

button_box_width( $buttons )

Computes the width required to draw the button box described by the 'buttons' parameter. This parameter is a hash reference.

button_label( $label, $max_button_width )

Returns a label suitable for a button considering that the maximum width of the button is $max_button_width.

layout_buttonbox( $container, $box, [ $padleft ], [ $padright ] )

Crops the labels of the Curses::UI::Buttonbox $box until it fits in the canvaswidth() of the $container. $padleft and $padright can be used to allow space for padding. The function will set the '-width' and '-x' attributes of the Buttonbox. In the worst case, the label will be reduced to their first letter. The Buttonbox's buttons should have their '-label' attribute set to the full label without any button decorations (like '['), these will be added by the function after cropping.


$Id:,v 1.7 2006/07/23 13:16:32 vanbaal Exp $


Wolfgang Sourdeau <[email protected]>


Copyright (C) 2004 Stichting LogReport Foundation [email protected]

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