1Curses::UI::Label(3) User Contributed Perl Documentation Curses::UI::Label(3)
2
3
4
6 Curses::UI::Label - Create and manipulate label widgets
7
9 Curses::UI::Widget
10 |
11 +----Curses::UI::Label
12
14 use Curses::UI;
15 my $cui = new Curses::UI;
16 my $win = $cui->add('window_id', 'Window');
17
18 my $label = $win->add(
19 'mylabel', 'Label',
20 -text => 'Hello, world!',
21 -bold => 1,
22 );
23
24 $label->draw;
25
27 Curses::UI::Label is a widget that shows a textstring. This textstring
28 can be drawn using these special features: bold, dimmed, reverse,
29 underlined, and blinking.
30
31 See exampes/demo-Curses::UI::Label in the distribution for a short
32 demo.
33
35 -parent, -x, -y, -width, -height, -pad, -padleft, -padright, -padtop,
36 -padbottom, -ipad, -ipadleft, -ipadright, -ipadtop, -ipadbottom,
37 -title, -titlefullwidth, -titlereverse, -onfocus, -onblur
38
39 For an explanation of these standard options, see Curses::UI::Widget.
40
42 · -height < VALUE >
43
44 If you do not define -height, the label will compute its needed
45 height using the initial -text.
46
47 · -text < TEXT >
48
49 This will set the text on the label to TEXT.
50
51 · -textalignment < VALUE >
52
53 This option controls how the text should be aligned inside the
54 label. VALUE can be 'left', 'middle' and 'right'. The default value
55 for this option is 'left'.
56
57 · -paddingspaces < BOOLEAN >
58
59 This option controls if padding spaces should be added to the text
60 if the text does not fill the complete width of the widget. The
61 default value for BOOLEAN is false. An example use of this option
62 is:
63
64 $win->add(
65 'label', 'Label',
66 -width => -1,
67 -paddingspaces => 1,
68 -text => 'A bit of text',
69 );
70
71 This will create a label that fills the complete width of your
72 screen and which will be completely in reverse font (also the part
73 that has no text on it). See the demo in the distribution
74 (examples/demo-Curses::UI::Label) for a clear example of this)
75
76 · -bold < BOOLEAN >
77
78 If BOOLEAN is true, text on the label will be drawn in a bold font.
79
80 · -dim < BOOLEAN >
81
82 If BOOLEAN is true, text on the label will be drawn in a dim font.
83
84 · -reverse < BOOLEAN >
85
86 If BOOLEAN is true, text on the label will be drawn in a reverse
87 font.
88
89 · -underline < BOOLEAN >
90
91 If BOOLEAN is true, text on the label will be drawn in an
92 underlined font.
93
94 · -blink < BOOLEAN >
95
96 If BOOLEAN is option is true, text on the label will be drawn in a
97 blinking font.
98
100 · new ( OPTIONS )
101
102 · layout ( )
103
104 · draw ( BOOLEAN )
105
106 · intellidraw ( )
107
108 · focus ( )
109
110 · onFocus ( CODEREF )
111
112 · onBlur ( CODEREF )
113
114 These are standard methods. See Curses::UI::Widget for an
115 explanation of these.
116
117 · bold ( BOOLEAN )
118
119 · dim ( BOOLEAN )
120
121 · reverse ( BOOLEAN )
122
123 · underline ( BOOLEAN )
124
125 · blink ( BOOLEAN )
126
127 These methods can be used to control the font in which the text on
128 the label is drawn, after creating the widget. The font option will
129 be turned on for a true value of BOOLEAN.
130
131 · textalignment ( VALUE )
132
133 Set the textalignment. VALUE can be 'left', 'middle' or 'right'.
134
135 · text ( [TEXT] )
136
137 Without the TEXT argument, this method will return the current text
138 of the widget. With a TEXT argument, the text on the widget will be
139 set to TEXT.
140
141 · get ( )
142
143 This will call the text method without any argument and thus it
144 will return the current text of the label.
145
147 Since a Label is a non-interacting widget, it does not have any
148 bindings.
149
151 Curses::UI, Curses::UI::Widget,
152
154 Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
155
156 Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)
157
158 This package is free software and is provided "as is" without express
159 or implied warranty. It may be used, redistributed and/or modified
160 under the same terms as perl itself.
161
162
163
164perl v5.12.0 2008-12-21 Curses::UI::Label(3)