Curses::Toolkit::Widget::Label - a widget to display text
version 0.208
This widget consists of a text label. This widget is more powerful than it looks : it supports line wrapping, and color, bold, underline, etc.
To be able to have more than simple text, the Label widget supports markup tags in its text, for example :
'foo <u>underlined bar</u> <span fgcolor="blue"> blue text <span bgcolor="red"> blue on red </span> normal on red </span> <b>bold</b>.'
<u>underlined string</u>
The <u> tag makes the enclosing text underlined
<b>bold string</b>
The <b> tag makes the enclosing text bold
The <span> tag allows more attributes to be set. Attributes can of course be combined :
<span wight="blink" fgcolor="black" bgcolor="red">Warning text!</span>
There is the list of attributes :
<span weight="reverse">some reverse string</span>
Specifies display attributes. Weight values can be :
normal : force some text back to normal standout : enable standout property underline : enable underline property blink : enable blink property dim : enable dim property bold : enable bold property
Somme properties may be unsupported on your terminal.
<span fgcolor="blue">some blue text</span>
Change the foreground color. values can be :
black red green yellow blue magenta cyan white
<span bgcolor="red">some red background text</span>
input : none output : a Curses::Toolkit::Widget::Label object
Set the text of the label. The text can be either normal text, or text with markups, to display colors, bold, underline, etc., see Markup Support above
input : the text output : the label object
Get the text of the Label
input : none output : STRING, the Label text
Set the text justification inside the label widget.
input : STRING, one of 'left', 'right', 'center' output : the label object
Get the text justification inside the label widget.
input : none output : STRING, one of 'left', 'right', 'center'
Set the wrap mode. 'never' means the label stay on one line (cut if not enough space is available), paragraphs are not interpreted. 'active' means the label tries to occupy space vertically (thus wrapping instead of extending to the right). 'lazy' means the label wraps if it is obliged to (not enough space to display on the same line), and on paragraphs
input : STRING, one of 'never', 'active', 'lazy' output : the label widget
Get the text wrap mode ofthe label widget.
input : none output : STRING, one of 'never', 'active', 'lazy'
Set the wrap method used. 'word' (the default) wraps on word. 'letter' makes the label wrap but at any point.
input : STRING, one of 'word', 'letter' output : the label widget
Get the text wrap method inside the label widget.
input : none output : STRING, one of 'word', 'letter'
Given a coordinate representing the available space, returns the space desired The Label desires the minimum space that lets it display entirely
input : a Curses::Toolkit::Object::Coordinates object output : a Curses::Toolkit::Object::Coordinates object
Given a coordinate representing the available space, returns the minimum space needed to properly display itself
Damien "dams" Krotkine
This software is copyright (c) 2011 by Damien "dams" Krotkine.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Curses::Toolkit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Curses::Toolkit
CPAN shell
perl -MCPAN -e shell install Curses::Toolkit
For more information on module installation, please visit the detailed CPAN module installation guide.