CLASS HIERARCHY

 Curses::UI::Widget
    |
    +----Curses::UI::Label

SYNOPSIS

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.

STANDARD OPTIONS

-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 < \s-1VALUE\s0 > If you do not define -height, the label will compute its needed height using the initial -text.

  • -text < \s-1TEXT\s0 > This will set the text on the label to \s-1TEXT\s0.

  • -textalignment < \s-1VALUE\s0 > This option controls how the text should be aligned inside the label. \s-1VALUE\s0 can be 'left', 'middle' and 'right'. The default value for this option is 'left'.

  • -paddingspaces < \s-1BOOLEAN\s0 > 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 for \s-1BOOLEAN\s0 is false. 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)

  • -bold < \s-1BOOLEAN\s0 > If \s-1BOOLEAN\s0 is true, text on the label will be drawn in a bold font.

  • -dim < \s-1BOOLEAN\s0 > If \s-1BOOLEAN\s0 is true, text on the label will be drawn in a dim font.

  • -reverse < \s-1BOOLEAN\s0 > If \s-1BOOLEAN\s0 is true, text on the label will be drawn in a reverse font.

  • -underline < \s-1BOOLEAN\s0 > If \s-1BOOLEAN\s0 is true, text on the label will be drawn in an underlined font.

  • -blink < \s-1BOOLEAN\s0 > If \s-1BOOLEAN\s0 is option is true, text on the label will be drawn in a blinking font.

METHODS

  • new ( \s-1OPTIONS\s0 )

  • layout ( )

  • draw ( \s-1BOOLEAN\s0 )

  • intellidraw ( )

  • focus ( )

  • onFocus ( \s-1CODEREF\s0 )

  • onBlur ( \s-1CODEREF\s0 ) These are standard methods. See Curses::UI::Widget for an explanation of these.

  • bold ( \s-1BOOLEAN\s0 )

  • dim ( \s-1BOOLEAN\s0 )

  • reverse ( \s-1BOOLEAN\s0 )

  • underline ( \s-1BOOLEAN\s0 )

  • blink ( \s-1BOOLEAN\s0 ) 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 \s-1BOOLEAN\s0.

  • textalignment ( \s-1VALUE\s0 ) Set the textalignment. \s-1VALUE\s0 can be 'left', 'middle' or 'right'.

  • text ( [\s-1TEXT\s0] ) Without the \s-1TEXT\s0 argument, this method will return the current text of the widget. With a \s-1TEXT\s0 argument, the text on the widget will be set to \s-1TEXT\s0.

  • get ( ) This will call the text method 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.

RELATED TO Curses::UI::Label…

Curses::UI, Curses::UI::Widget,

AUTHOR

Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.

Maintained by Marcus Thiesen ([email protected])

This package is free software and is provided \*(L"as is\*(R" without express or implied warranty. It may be used, redistributed and/or modified under the same terms as perl itself.