Tickit::Pen - store a collection of rendering attributes
Tickit::Pen
Stores rendering attributes for text to display.
Supports the following named pen attributes:
Foreground or background colour. COL may be an integer or one of the eight colour names. A colour name may optionally be prefixed by hi- for the high-intensity version (may not be supported by all terminals). Some terminals may support a palette of 256 colours instead, some 16, and some only 8. The Pen object will not check this as it cannot be reliably detected in all cases.
COL
hi-
Pen
Bold, underline, italics, reverse video, strikethrough.
Alternate font.
Note that not all terminals can render the italics, strikethrough, or alternate font attributes.
Returns a new pen, initialised from the given attributes.
Returns a new pen, initialised from keys in the given HASH reference. Used keys are deleted from the hash.
Returns a new pen, initialised by copying the attributes of the original.
Returns true if the given attribute exists on this object
Returns the current value of the given attribute
Returns a key/value list of all the attributes
Change the value of an attribute. Setting undef implies default value. To delete an attribute altogether, see instead delattr.
undef
delattr
Change the values of all the attributes given in the hash. Recgonised attributes will be deleted from the hash.
Delete an attribute from this pen. This attribute will no longer be modified by this pen.
Copy attributes from the given pen. copy_from will override attributes already defined by $pen; default_from will only copy attributes that are not yet defined by $pen.
copy_from
$pen
default_from
As a convenience both methods return $pen.
Add an observer to the list of objects which will be informed when the pen attributes change. The observer will be informed by invoking a method on_pen_changed, passing in the pen reference and the opaque ID value given to this method.
on_pen_changed
$observer->on_pen_changed( $pen, $id )
The observer object is stored weakly, so it is safe to add the Tickit::Widget object that is using the pen as an observer. The ID value is not weakened.
Tickit::Widget
Remove an observer previously added by add_on_changed.
add_on_changed
Paul Evans <leonerd@leonerd.org.uk>
To install Tickit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tickit
CPAN shell
perl -MCPAN -e shell install Tickit
For more information on module installation, please visit the detailed CPAN module installation guide.