line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
# Curses::UI::Label |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# (c) 2001-2002 by Maurice Makaay. All rights reserved. |
5
|
|
|
|
|
|
|
# This file is part of Curses::UI. Curses::UI is free software. |
6
|
|
|
|
|
|
|
# You can redistribute it and/or modify it under the same terms |
7
|
|
|
|
|
|
|
# as perl itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# Currently maintained by Marcus Thiesen |
10
|
|
|
|
|
|
|
# e-mail: marcus@cpan.thiesenweb.de |
11
|
|
|
|
|
|
|
# ---------------------------------------------------------------------- |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# TODO: fix dox |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Curses::UI::Label; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
18
|
1
|
|
|
1
|
|
4
|
use Curses; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2996
|
|
19
|
1
|
|
|
1
|
|
7
|
use Curses::UI::Widget; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
20
|
1
|
|
|
1
|
|
6
|
use Curses::UI::Common; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
190
|
|
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
1395
|
use vars qw( |
23
|
|
|
|
|
|
|
$VERSION |
24
|
|
|
|
|
|
|
@ISA |
25
|
1
|
|
|
1
|
|
7
|
); |
|
1
|
|
|
|
|
2
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
$VERSION = '1.11'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
@ISA = qw( |
30
|
|
|
|
|
|
|
Curses::UI::Widget |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new () |
34
|
|
|
|
|
|
|
{ |
35
|
1
|
|
|
1
|
1
|
2
|
my $class = shift; |
36
|
|
|
|
|
|
|
|
37
|
1
|
|
|
|
|
4
|
my %userargs = @_; |
38
|
1
|
|
|
|
|
4
|
keys_to_lowercase(\%userargs); |
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
16
|
my %args = ( |
41
|
|
|
|
|
|
|
-parent => undef, # the parent window |
42
|
|
|
|
|
|
|
-width => undef, # the width of the label |
43
|
|
|
|
|
|
|
-height => undef, # the height of the label |
44
|
|
|
|
|
|
|
-x => 0, # the hor. pos. rel. to the parent |
45
|
|
|
|
|
|
|
-y => 0, # the vert. pos. rel. to the parent |
46
|
|
|
|
|
|
|
-text => undef, # the text to show |
47
|
|
|
|
|
|
|
-textalignment => undef, # left / middle / right |
48
|
|
|
|
|
|
|
-bold => 0, # Special attributes |
49
|
|
|
|
|
|
|
-reverse => 0, |
50
|
|
|
|
|
|
|
-underline => 0, |
51
|
|
|
|
|
|
|
-dim => 0, |
52
|
|
|
|
|
|
|
-blink => 0, |
53
|
|
|
|
|
|
|
-paddingspaces => 0, # Pad text with spaces? |
54
|
|
|
|
|
|
|
-bg => -1, |
55
|
|
|
|
|
|
|
-fg => -1, |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
%userargs, |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
-nocursor => 1, # This widget uses no cursor |
60
|
|
|
|
|
|
|
-focusable => 0, # This widget can't be focused |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Get the text dimension if -width or -height is undefined. |
64
|
1
|
|
|
|
|
3
|
my @text_dimension = (undef,1); |
65
|
1
|
50
|
33
|
|
|
5
|
unless (defined $args{-width} and defined $args{-height}) { |
66
|
1
|
50
|
|
|
|
4
|
@text_dimension = text_dimension($args{-text}) |
67
|
|
|
|
|
|
|
if defined $args{-text}; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# If the -height is not set, determine the height |
71
|
|
|
|
|
|
|
# using the initial contents of the -text. |
72
|
1
|
50
|
|
|
|
5
|
if (not defined $args{-height}) |
73
|
|
|
|
|
|
|
{ |
74
|
1
|
|
|
|
|
1
|
my $l = $text_dimension[1]; |
75
|
1
|
50
|
|
|
|
4
|
$l = 1 if $l <= 0; |
76
|
1
|
|
|
|
|
8
|
$args{-height} = height_by_windowscrheight($l, %args); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# No width given? Then make the width the same size |
80
|
|
|
|
|
|
|
# as the text. No initial text? Then let |
81
|
|
|
|
|
|
|
# Curses::UI::Widget figure it out. |
82
|
1
|
50
|
33
|
|
|
16
|
$args{-width} = width_by_windowscrwidth($text_dimension[0], %args) |
83
|
|
|
|
|
|
|
unless defined $args{-width} or not defined $args{-text}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# If no text was defined (how silly...) we define an empty string. |
86
|
1
|
50
|
|
|
|
5
|
$args{-text} = '' unless defined $args{-text}; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Create the widget. |
89
|
1
|
|
|
|
|
10
|
my $this = $class->SUPER::new( %args ); |
90
|
|
|
|
|
|
|
|
91
|
1
|
|
|
|
|
4
|
$this->layout(); |
92
|
|
|
|
|
|
|
|
93
|
1
|
|
|
|
|
5
|
return $this; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub layout() |
97
|
|
|
|
|
|
|
{ |
98
|
2
|
|
|
2
|
1
|
3
|
my $this = shift; |
99
|
2
|
50
|
|
|
|
9
|
$this->SUPER::layout or return; |
100
|
2
|
|
|
|
|
4
|
return $this; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
0
|
1
|
0
|
sub bold ($;$) { shift()->set_attribute('-bold', shift()) } |
105
|
0
|
|
|
0
|
1
|
0
|
sub reverse ($;$) { shift()->set_attribute('-reverse', shift()) } |
106
|
0
|
|
|
0
|
1
|
0
|
sub underline ($;$) { shift()->set_attribute('-underline', shift()) } |
107
|
0
|
|
|
0
|
1
|
0
|
sub dim ($;$) { shift()->set_attribute('-dim', shift()) } |
108
|
0
|
|
|
0
|
1
|
0
|
sub blink ($;$) { shift()->set_attribute('-blink', shift()) } |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub set_attribute($$;) |
111
|
|
|
|
|
|
|
{ |
112
|
0
|
|
|
0
|
0
|
0
|
my $this = shift; |
113
|
0
|
|
|
|
|
0
|
my $attribute = shift; |
114
|
0
|
|
0
|
|
|
0
|
my $value = shift || 0; |
115
|
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
0
|
$this->{$attribute} = $value; |
117
|
0
|
|
|
|
|
0
|
$this->intellidraw; |
118
|
|
|
|
|
|
|
|
119
|
0
|
|
|
|
|
0
|
return $this; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub text($;$) |
125
|
|
|
|
|
|
|
{ |
126
|
2
|
|
|
2
|
1
|
607
|
my $this = shift; |
127
|
2
|
|
|
|
|
5
|
my $text = shift; |
128
|
|
|
|
|
|
|
|
129
|
2
|
100
|
|
|
|
4
|
if (defined $text) |
130
|
|
|
|
|
|
|
{ |
131
|
1
|
|
|
|
|
3
|
$this->{-text} = $text; |
132
|
1
|
|
|
|
|
9
|
$this->intellidraw; |
133
|
1
|
|
|
|
|
2
|
return $this; |
134
|
|
|
|
|
|
|
} else { |
135
|
1
|
|
|
|
|
8
|
return $this->{-text}; |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
1
|
|
|
1
|
1
|
5
|
sub get() { shift()->text } |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub textalignment($;) |
142
|
|
|
|
|
|
|
{ |
143
|
0
|
|
|
0
|
1
|
0
|
my $this = shift; |
144
|
0
|
|
|
|
|
0
|
my $value = shift; |
145
|
0
|
|
|
|
|
0
|
$this->{-textalignment} = $value; |
146
|
0
|
|
|
|
|
0
|
$this->intellidraw; |
147
|
0
|
|
|
|
|
0
|
return $this; |
148
|
|
|
|
|
|
|
} |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub compute_xpos() |
151
|
|
|
|
|
|
|
{ |
152
|
1
|
|
|
1
|
0
|
2
|
my $this = shift; |
153
|
1
|
|
|
|
|
1
|
my $line = shift; |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
# Compute the x location of the text. |
156
|
1
|
|
|
|
|
2
|
my $xpos = 0; |
157
|
1
|
50
|
|
|
|
4
|
if (defined $this->{-textalignment}) |
158
|
|
|
|
|
|
|
{ |
159
|
0
|
0
|
|
|
|
0
|
if ($this->{-textalignment} eq 'right') { |
|
|
0
|
|
|
|
|
|
160
|
0
|
|
|
|
|
0
|
$xpos = $this->canvaswidth - length($line); |
161
|
|
|
|
|
|
|
} elsif ($this->{-textalignment} eq 'middle') { |
162
|
0
|
|
|
|
|
0
|
$xpos = int (($this->canvaswidth-length($line))/2); |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
} |
165
|
1
|
50
|
|
|
|
3
|
$xpos = 0 if $xpos < 0; |
166
|
1
|
|
|
|
|
2
|
return $xpos; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub draw(;$) |
170
|
|
|
|
|
|
|
{ |
171
|
1
|
|
|
1
|
1
|
1
|
my $this = shift; |
172
|
1
|
|
50
|
|
|
10
|
my $no_doupdate = shift || 0; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Draw the widget. |
175
|
1
|
50
|
|
|
|
8
|
$this->SUPER::draw(1) or return $this; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# Clear all attributes. |
178
|
1
|
|
|
|
|
12
|
$this->{-canvasscr}->attroff(A_REVERSE); |
179
|
1
|
|
|
|
|
410
|
$this->{-canvasscr}->attroff(A_BOLD); |
180
|
1
|
|
|
|
|
220
|
$this->{-canvasscr}->attroff(A_UNDERLINE); |
181
|
1
|
|
|
|
|
193
|
$this->{-canvasscr}->attroff(A_BLINK); |
182
|
1
|
|
|
|
|
208
|
$this->{-canvasscr}->attroff(A_DIM); |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# Set wanted attributes. |
185
|
1
|
50
|
|
|
|
237
|
$this->{-canvasscr}->attron(A_REVERSE) if $this->{-reverse}; |
186
|
1
|
50
|
|
|
|
4
|
$this->{-canvasscr}->attron(A_BOLD) if $this->{-bold}; |
187
|
1
|
50
|
|
|
|
4
|
$this->{-canvasscr}->attron(A_UNDERLINE) if $this->{-underline}; |
188
|
1
|
50
|
|
|
|
10
|
$this->{-canvasscr}->attron(A_BLINK) if $this->{-blink}; |
189
|
1
|
50
|
|
|
|
4
|
$this->{-canvasscr}->attron(A_DIM) if $this->{-dim}; |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
# Let there be color |
192
|
1
|
50
|
|
|
|
3
|
if ($Curses::UI::color_support) { |
193
|
0
|
|
|
|
|
0
|
my $co = $Curses::UI::color_object; |
194
|
0
|
|
|
|
|
0
|
my $pair = $co->get_color_pair( |
195
|
|
|
|
|
|
|
$this->{-fg}, |
196
|
|
|
|
|
|
|
$this->{-bg}); |
197
|
|
|
|
|
|
|
|
198
|
0
|
|
|
|
|
0
|
$this->{-canvasscr}->attron(COLOR_PAIR($pair)); |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
# Draw the text. Clip it if it is too long. |
203
|
1
|
|
|
|
|
2
|
my $ypos = 0; |
204
|
1
|
|
|
|
|
5
|
my $split = split_to_lines($this->{-text}); |
205
|
1
|
|
|
|
|
2
|
foreach my $line (@$split) |
206
|
|
|
|
|
|
|
{ |
207
|
1
|
50
|
|
|
|
9
|
if (length($line) > $this->canvaswidth) { |
|
|
0
|
|
|
|
|
|
208
|
|
|
|
|
|
|
# Break text |
209
|
1
|
|
|
|
|
4
|
$line = substr($line, 0, $this->canvaswidth); |
210
|
1
|
|
|
|
|
9
|
$line =~ s/.$/\$/; |
211
|
|
|
|
|
|
|
} elsif ($this->{-paddingspaces}) { |
212
|
0
|
|
|
|
|
0
|
$this->{-canvasscr}->addstr($ypos, 0, " "x$this->canvaswidth); |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
|
215
|
1
|
|
|
|
|
3
|
my $xpos = $this->compute_xpos($line); |
216
|
1
|
|
|
|
|
6
|
$this->{-canvasscr}->addstr($ypos, $xpos, $line); |
217
|
|
|
|
|
|
|
|
218
|
1
|
|
|
|
|
207
|
$ypos++; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
1
|
|
|
|
|
5
|
$this->{-canvasscr}->noutrefresh; |
222
|
1
|
50
|
|
|
|
4
|
doupdate() unless $no_doupdate; |
223
|
|
|
|
|
|
|
|
224
|
1
|
|
|
|
|
3
|
return $this; |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
1; |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
=pod |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head1 NAME |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
Curses::UI::Label - Create and manipulate label widgets |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=head1 CLASS HIERARCHY |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
Curses::UI::Widget |
242
|
|
|
|
|
|
|
| |
243
|
|
|
|
|
|
|
+----Curses::UI::Label |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=head1 SYNOPSIS |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
use Curses::UI; |
250
|
|
|
|
|
|
|
my $cui = new Curses::UI; |
251
|
|
|
|
|
|
|
my $win = $cui->add('window_id', 'Window'); |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
my $label = $win->add( |
254
|
|
|
|
|
|
|
'mylabel', 'Label', |
255
|
|
|
|
|
|
|
-text => 'Hello, world!', |
256
|
|
|
|
|
|
|
-bold => 1, |
257
|
|
|
|
|
|
|
); |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
$label->draw; |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
=head1 DESCRIPTION |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
Curses::UI::Label is a widget that shows a textstring. |
266
|
|
|
|
|
|
|
This textstring can be drawn using these special |
267
|
|
|
|
|
|
|
features: bold, dimmed, reverse, underlined, and blinking. |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
See exampes/demo-Curses::UI::Label in the distribution |
270
|
|
|
|
|
|
|
for a short demo. |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
=head1 STANDARD OPTIONS |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
B<-parent>, B<-x>, B<-y>, B<-width>, B<-height>, |
277
|
|
|
|
|
|
|
B<-pad>, B<-padleft>, B<-padright>, B<-padtop>, B<-padbottom>, |
278
|
|
|
|
|
|
|
B<-ipad>, B<-ipadleft>, B<-ipadright>, B<-ipadtop>, B<-ipadbottom>, |
279
|
|
|
|
|
|
|
B<-title>, B<-titlefullwidth>, B<-titlereverse>, B<-onfocus>, |
280
|
|
|
|
|
|
|
B<-onblur> |
281
|
|
|
|
|
|
|
|
282
|
|
|
|
|
|
|
For an explanation of these standard options, see |
283
|
|
|
|
|
|
|
L. |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
|
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
=head1 WIDGET-SPECIFIC OPTIONS |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=over 4 |
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=item * B<-height> < VALUE > |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
If you do not define B<-height>, the label will compute |
295
|
|
|
|
|
|
|
its needed height using the initial B<-text>. |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=item * B<-text> < TEXT > |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
This will set the text on the label to TEXT. |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
=item * B<-textalignment> < VALUE > |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
This option controls how the text should be aligned inside |
304
|
|
|
|
|
|
|
the label. VALUE can be 'left', 'middle' and 'right'. The |
305
|
|
|
|
|
|
|
default value for this option is 'left'. |
306
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
=item * B<-paddingspaces> < BOOLEAN > |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
This option controls if padding spaces should be added |
310
|
|
|
|
|
|
|
to the text if the text does not fill the complete width |
311
|
|
|
|
|
|
|
of the widget. The default value for BOOLEAN is false. |
312
|
|
|
|
|
|
|
An example use of this option is: |
313
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
$win->add( |
315
|
|
|
|
|
|
|
'label', 'Label', |
316
|
|
|
|
|
|
|
-width => -1, |
317
|
|
|
|
|
|
|
-paddingspaces => 1, |
318
|
|
|
|
|
|
|
-text => 'A bit of text', |
319
|
|
|
|
|
|
|
); |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
This will create a label that fills the complete width of |
322
|
|
|
|
|
|
|
your screen and which will be completely in reverse font |
323
|
|
|
|
|
|
|
(also the part that has no text on it). See the demo |
324
|
|
|
|
|
|
|
in the distribution (examples/demo-Curses::UI::Label) |
325
|
|
|
|
|
|
|
for a clear example of this) |
326
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=item * B<-bold> < BOOLEAN > |
328
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
If BOOLEAN is true, text on the label will be drawn in |
330
|
|
|
|
|
|
|
a bold font. |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=item * B<-dim> < BOOLEAN > |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
If BOOLEAN is true, text on the label will be drawn in |
335
|
|
|
|
|
|
|
a dim font. |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
=item * B<-reverse> < BOOLEAN > |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
If BOOLEAN is true, text on the label will be drawn in |
340
|
|
|
|
|
|
|
a reverse font. |
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=item * B<-underline> < BOOLEAN > |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
If BOOLEAN is true, text on the label will be drawn in |
345
|
|
|
|
|
|
|
an underlined font. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=item * B<-blink> < BOOLEAN > |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
If BOOLEAN is option is true, text on the label will be |
350
|
|
|
|
|
|
|
drawn in a blinking font. |
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=back |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=head1 METHODS |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=over 4 |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
=item * B ( OPTIONS ) |
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=item * B ( ) |
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=item * B ( BOOLEAN ) |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=item * B ( ) |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=item * B ( ) |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=item * B ( CODEREF ) |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
=item * B ( CODEREF ) |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
These are standard methods. See L |
376
|
|
|
|
|
|
|
for an explanation of these. |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=item * B ( BOOLEAN ) |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=item * B ( BOOLEAN ) |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=item * B ( BOOLEAN ) |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=item * B ( BOOLEAN ) |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=item * B |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
These methods can be used to control the font in which the text on |
389
|
|
|
|
|
|
|
the label is drawn, after creating the widget. The font option |
390
|
|
|
|
|
|
|
will be turned on for a true value of BOOLEAN. |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=item * B ( VALUE ) |
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Set the textalignment. VALUE can be 'left', |
395
|
|
|
|
|
|
|
'middle' or 'right'. |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=item * B ( [TEXT] ) |
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
Without the TEXT argument, this method will return the current |
400
|
|
|
|
|
|
|
text of the widget. With a TEXT argument, the text on the widget |
401
|
|
|
|
|
|
|
will be set to TEXT. |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=item * B ( ) |
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
This will call the B method without any argument and thus |
406
|
|
|
|
|
|
|
it will return the current text of the label. |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=back |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=head1 DEFAULT BINDINGS |
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
Since a Label is a non-interacting widget, it does not have |
416
|
|
|
|
|
|
|
any bindings. |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
=head1 SEE ALSO |
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
L, |
424
|
|
|
|
|
|
|
L, |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=head1 AUTHOR |
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
Copyright (c) 2001-2002 Maurice Makaay. All rights reserved. |
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de) |
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
This package is free software and is provided "as is" without express |
437
|
|
|
|
|
|
|
or implied warranty. It may be used, redistributed and/or modified |
438
|
|
|
|
|
|
|
under the same terms as perl itself. |
439
|
|
|
|
|
|
|
|