Curses::UI::Label(3)
β¨ NAME β¨
Curses::UI::Label β Create and manipulate label widgets.
okay so this is the Curses::UI::Label(3) manual page from the User Contributed Perl Documentation, and it's literally all about making a label widget do its lil text thing π
𧬠CLASS HIERARCHY π§¬
the family tree is giving βwidget with a label glow-upβ:
Curses::UI::Widget
|
+----Curses::UI::Label
π SYNOPSIS π
bestie, here's the whole vibe:
use Curses::UI;
my $cui = new Curses::UI;
my $win = $cui->add('window_id', 'Window');
my $label = $win->add(
'mylabel', 'Label',
-text => 'Hello, world!',
-bold => 1,
);
$label->draw;
πΈ DESCRIPTION πΈ
Curses::UI::Label is a widget that shows a textstring. This textstring can be drawn using these special features: bold, dimmed, reverse, underlined, and blinking.
See exampes/demo-Curses::UI::Label in the distribution for a short demo. (Yes, exampes is exactly how it's spelled there, no cap β paths stay exact π)
π STANDARD OPTIONS π
The standard options are -parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop, -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom, -title, -titlefullwidth, -titlereverse, -onfocus, -onblur.
For an explanation of these standard options, see Curses::UI::Widget.
π₯ WIDGET-SPECIFIC OPTIONS π₯
-height < VALUE >β If you do not define-height, the label will compute its needed height using the initial-text. It's giving βI'll measure myself, thanksβ π-text < TEXT >β This will set the text on the label toTEXT. Iconic.-textalignment < VALUE >β This option controls how the text should be aligned inside the label.VALUEcan be'left','middle'and'right'. The default value for this option is'left'.-paddingspaces < BOOLEAN >β This option controls if padding spaces should be added to the text if the text does not fill the complete width of the widget. The default value forBOOLEANisfalse. An example use of this option is:
$win->add(
'label', 'Label',
-width => -1,
-paddingspaces => 1,
-text => 'A bit of text',
);
This will create a label that fills the complete width of your screen and which will be completely in reverse font (also the part that has no text on it). See the demo in the distribution (examples/demo-Curses::UI::Label) for a clear example of this) β and yes, that closing paren is canon π
-bold < BOOLEAN >β IfBOOLEANis true, text on the label will be drawn in a bold font.-dim < BOOLEAN >β IfBOOLEANis true, text on the label will be drawn in a dim font.-reverse < BOOLEAN >β IfBOOLEANis true, text on the label will be drawn in a reverse font.-underline < BOOLEAN >β IfBOOLEANis true, text on the label will be drawn in an underlined font.-blink < BOOLEAN >β IfBOOLEANis true, text on the label will be drawn in a blinking font. Sparkle mode, basically β¨
π¦ METHODS π¦
new ( OPTIONS )layout ( )draw ( BOOLEAN )intellidraw ( )focus ( )onFocus ( CODEREF )onBlur ( CODEREF )
These are standard methods. See Curses::UI::Widget for an explanation of these.
bold ( BOOLEAN )dim ( BOOLEAN )reverse ( BOOLEAN )underline ( BOOLEAN )blink ( BOOLEAN )
These methods can be used to control the font in which the text on the label is drawn, after creating the widget. The font option will be turned on for a true value of BOOLEAN.
textalignment ( VALUE )β Set the textalignment.VALUEcan be'left','middle'or'right'.text ( [TEXT] )β Without theTEXTargument, this method will return the current text of the widget. With aTEXTargument, the text on the widget will be set toTEXT.get ( )β This will call thetextmethod without any argument and thus it will return the current text of the label.
π DEFAULT BINDINGS π
Since a Label is a non-interacting widget, it does not have any bindings. It's literally just sitting there looking cute. No keys to press, no drama, periodt.
π SEE ALSO π
Curses::UI, Curses::UI::Widget, (trailing comma included because the original said so, bestie).
π AUTHOR π
Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)
This package is free software and is provided "as is" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.
π
kisses, this page is brought to you by perl v5.42.2, dated 2023-07-03, and filed under Curses::UI::Label(3) π«Ά
π¦ where this page comes from
- alpine 3.24: perl-curses-ui-doc 0.9609-r3 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms