Widgets::Label(3pm)
π NAME π
Curses::Widgets::Label β Label Widgets, bestie!! it's giving "little text box that just sits there and looks cute" and honestly? iconic.
π MODULE VERSION π
$Id: Label.pm,v 1.102 2002/11/03 23:36:21 corliss Exp corliss $
yes queen, that's the whole version line, don't @ me, it's literally in the source π
β¨ SYNOPSIS β¨
use Curses::Widgets::Label;
$lbl = Curses::Widgets::Label->new({
COLUMNS => 10,
LINES => 1,
VALUE => 'Name:',
FOREGROUND => undef,
BACKGROUND => 'black',
X => 1,
Y => 1,
ALIGNMENT => 'R',
});
$tf->draw($mwh);
See the Curses::Widgets pod for other methods.
okay so that last line is in the synopsis, it's not me being lazy, it's literally telling you to go read Curses::Widgets pod for the other methods π«Ά
πΈ REQUIREMENTS πΈ
CursesCurses::Widgets
no cap, you need both or nothing works π§
π¦ DESCRIPTION π¦
Curses::Widgets::Label provides simplified OO access to Curses-based single or multi-line labels.
that's it. that's the whole vibe. one label, infinite potential, main character energy only β¨
π METHODS π
π new (inherited from Curses::Widgets)
$lbl = Curses::Widgets::Label->new({
COLUMNS => 10,
LINES => 1,
VALUE => 'Name:',
FOREGROUND => undef,
BACKGROUND => 'black',
X => 1,
Y => 1,
ALIGNMENT => 'R',
});
The new method instantiates a new Label object. the only mandatory key/value pairs in the configuration hash are X and Y β everything else is optional and has defaults, periodt.
All the other keys default like this:
COLUMNSβ default10β Number of columns displayedLINESβ default1β Number of lines displayedVALUEβ default''β Label textFOREGROUNDβ defaultundefβ Default foreground colourBACKGROUNDβ defaultundefβ Default background colourALIGNMENTβ defaultLβ'R'ight,'L'eft, or `'C'entered
If the label is a multi-line label it will filter the current VALUE through the Curses::Widgets::textwrap function to break it along whitespace and newlines. lowkey magical, it just wraps itself, no manual line breaks needed π
π draw
$tf->draw($mwh);
The draw method renders the text field in its current state. This requires a valid handle to a curses window in which it will render itself.
heads up bestie: no valid window handle, no render. that's not optional, that's the whole assignment π
π HISTORY π
2002/10/18 -- First implementation
the origin story. the birth of the label. we love a debut β¨
π AUTHOR/COPYRIGHT π
(c) 2001 Arthur Corliss (corliss@digitalmages.com)
okay that's the whole page!! Widgets::Label(3pm) from perl v5.34.0, dated 2022-06-12 β mwah, go forth and label things, bestie ππβ¨
π¦ where this page comes from
- debian bookworm: libcurses-widgets-perl 1.997-8
- debian trixie: libcurses-widgets-perl 1.997-8
- ubuntu noble: libcurses-widgets-perl 1.997-8
- ubuntu resolute: libcurses-widgets-perl 1.997-8
- ubuntu stonking: libcurses-widgets-perl 1.997-8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms