---
name: "Lire::UI::Utils"
section: "3pm"
platform: "linux"
package: "lire"
version: "2.1.1-8"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Lire::UI::Utils"
---

# Lire::UI::Utils(3pm)

Utility functions for UI management

## NAME

Lire::UI::Utils - Utility functions for UI management

## SYNOPSIS

```
  use Lire::UI::Utils;
```

## DESCRIPTION

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.

## SEE ALSO

[**Lire::UI**(3pm)](/Lire::UI/3pm.md)

## 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.
