Paul Evans > Tickit-0.44 > Tickit::WidgetRole::Penable

Download:
Tickit-0.44.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Module Version: 0.44   Source   Latest Release: Tickit-0.46

NAME ^

Tickit::WidgetRole::Penable - implement widgets with setable pens

DESCRIPTION ^

Mixing this parametric role into a Tickit::Widget subclass adds behaviour to implement a custom pen. The mixing widget will automatically subscribe to the pen for updates by its add_on_changed method. The mixing widget class still responsible for implementing the on_pen_changed method.

METHODS ^

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

 use Tickit::WidgetRole::Penable name => NAME, default => DEFAULT

The parameters are

name => STRING

Required. The name to use for NAME in the following generated methods, and used as the $id identifier to the add_on_changed method.

default => HASH

Optional. A HASH reference containing the default attributes this pen should have on initialisation.

$pen = $widget->NAME_pen

Returns the Tickit::Pen instance.

$widget->set_NAME_pen( $pen )

Sets a new pen instance.

$widget->_init_NAME_pen

Sets the initial default value of the pen, by calling set_NAME_pen.

AUTHOR ^

Paul Evans <leonerd@leonerd.org.uk>

syntax highlighting: