---
name: "Tickit::Widget::Border"
section: "3pm"
platform: "linux"
package: "libtickit-widgets-perl"
version: "0.42-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Tickit::Widget::Border"
---

# Tickit::Widget::Border(3pm)

draw a fixed-size border around a widget

## NAME

"Tickit::Widget::Border" - draw a fixed-size border around a widget

## SYNOPSIS

```
   use Tickit;
   use Tickit::Widget::Border;
   use Tickit::Widget::Static;
   my $border = Tickit::Widget::Border->new
      ->set_child(
         Tickit::Widget::Static->new(
            text   => "Hello, world",
            align  => "centre",
            valign => "middle",
         )
      );
   Tickit->new( root => $border )->run;
```

## DESCRIPTION

This container widget holds a single child widget and implements a border by using Tickit::WidgetRole::Borderable.

## STYLE

The default style pen is used as the widget pen.

## CONSTRUCTOR

### new

```
   $border = Tickit::Widget::Border->new( %args );
```

Constructs a new `"Tickit::Widget::Border"` object.

Takes arguments having the names of any of the `"set_*"` methods listed below, without the `"set_"` prefix.

## ACCESSSORS

### top\_border

### set\_top\_border

```
   $lines = $border->top_border;
   $border->set_top_border( $lines );
```

Return or set the number of lines of border at the top of the widget

### bottom\_border

### set\_bottom\_border

```
   $lines = $border->bottom_border;
   $border->set_bottom_border( $lines );
```

Return or set the number of lines of border at the bottom of the widget

### left\_border

### set\_left\_border

```
   $cols = $border->left_border;
   $border->set_left_border( $cols );
```

Return or set the number of cols of border at the left of the widget

### right\_border

### set\_right\_border

```
   $cols = $border->right_border;
   $border->set_right_border( $cols );
```

Return or set the number of cols of border at the right of the widget

### set\_h\_border

```
   $border->set_h_border( $cols );
```

Set the number of cols of both horizontal (left and right) borders simultaneously

### set\_v\_border

```
   $border->set_v_border( $cols );
```

Set the number of lines of both vertical (top and bottom) borders simultaneously

### set\_border

```
   $border->set_border( $count );
```

Set the number of cols or lines in all four borders simultaneously

## AUTHOR

Paul Evans \<leonerd@leonerd.org.uk\>
