NAME

Tickit::WidgetRole::Borderable - implement widgets with a surrounding border

DESCRIPTION

Mixing this role into a Tickit::Widget subclass adds behaviour to handle a border around the widget's contents.

METHODS

The following methods are provided on the caller package when this module is imported by

use Tickit::WidgetRole::Borderable;

$widget->_border_init( $argsref )

Initialises the border state from constructor arguments in the referenced hash. Deletes keys that are used. Arguments may be the names any of the set_* methods named below.

$lines = $widget->top_border

$widget->set_top_border( $lines )

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

$lines = $widget->bottom_border

$widget->set_bottom_border( $lines )

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

$cols = $widget->left_border

$widget->set_left_border( $cols )

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

$cols = $widget->right_border

$widget->set_right_border( $cols )

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

$widget->set_h_border( $cols )

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

$widget->set_v_border( $cols )

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

$widget->set_border( $count )

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

( $top, $left, $lines, $cols ) = $widget->get_border_geom

Returns a 4-element list giving the geometry of the inside of the border; the area in which the bordered widget should draw.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>