Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # Copyright (c) 1990-1994 The Regents of the University of California. |
2 | # Copyright (c) 1994-1996 Sun Microsystems, Inc. | |
3 | # See the file "license.terms" for information on usage and redistribution | |
4 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. | |
5 | # | |
6 | # | |
7 | ||
8 | =head1 NAME | |
9 | ||
10 | Tk::Label - Create and manipulate Label widgets | |
11 | ||
12 | =for category Tk Widget Classes | |
13 | ||
14 | =head1 SYNOPSIS | |
15 | ||
16 | I<$label> = I<$parent>-E<gt>B<Label>(?I<options>?); | |
17 | ||
18 | =head1 STANDARD OPTIONS | |
19 | ||
20 | B<-anchor> B<-font> B<-image> B<-takefocus> | |
21 | B<-background> B<-foreground> B<-justify> B<-text> | |
22 | B<-bitmap> B<-highlightbackground> B<-padx> B<-textvariable> | |
23 | B<-borderwidth> B<-highlightcolor> B<-pady> B<-underline> | |
24 | B<-cursor> B<-highlightthickness> B<-relief> B<-wraplength> | |
25 | ||
26 | See L<Tk::options> for details of the standard options. | |
27 | ||
28 | =head1 WIDGET-SPECIFIC OPTIONS | |
29 | ||
30 | =over 4 | |
31 | ||
32 | =item Name: B<height> | |
33 | ||
34 | =item Class: B<Height> | |
35 | ||
36 | =item Switch: B<-height> | |
37 | ||
38 | Specifies a desired height for the label. | |
39 | If an image or bitmap is being displayed in the label then the value is in | |
40 | screen units (i.e. any of the forms acceptable to B<Tk_GetPixels>); | |
41 | for text it is in lines of text. | |
42 | If this option isn't specified, the label's desired height is computed | |
43 | from the size of the image or bitmap or text being displayed in it. | |
44 | ||
45 | =item Name: B<width> | |
46 | ||
47 | =item Class: B<Width> | |
48 | ||
49 | =item Switch: B<-width> | |
50 | ||
51 | Specifies a desired width for the label. | |
52 | If an image or bitmap is being displayed in the label then the value is in | |
53 | screen units (i.e. any of the forms acceptable to B<Tk_GetPixels>); | |
54 | for text it is in characters. | |
55 | If this option isn't specified, the label's desired width is computed | |
56 | from the size of the image or bitmap or text being displayed in it. | |
57 | ||
58 | =back | |
59 | ||
60 | =head1 DESCRIPTION | |
61 | ||
62 | The B<Label> method creates a new window (given by the | |
63 | $widget argument) and makes it into a label widget. | |
64 | Additional | |
65 | options, described above, may be specified on the command line | |
66 | or in the option database | |
67 | to configure aspects of the label such as its colors, font, | |
68 | text, and initial relief. The B<label> command returns its | |
69 | $widget argument. At the time this command is invoked, | |
70 | there must not exist a window named $widget, but | |
71 | $widget's parent must exist. | |
72 | ||
73 | A label is a widget that displays a textual string, bitmap or image. | |
74 | If text is displayed, it must all be in a single font, but it | |
75 | can occupy multiple lines on the screen (if it contains newlines | |
76 | or if wrapping occurs because of the B<wrapLength> option) and | |
77 | one of the characters may optionally be underlined using the | |
78 | B<underline> option. | |
79 | The label can be manipulated in a few simple ways, such as | |
80 | changing its relief or text, using the commands described below. | |
81 | ||
82 | =head1 WIDGET METHODS | |
83 | ||
84 | The B<Label> method creates a widget object. | |
85 | This object supports the B<configure> and B<cget> methods | |
86 | described in L<Tk::options> which can be used to enquire and | |
87 | modify the options described above. | |
88 | The widget also inherits all the methods provided by the generic | |
89 | L<Tk::Widget|Tk::Widget> class. | |
90 | ||
91 | =head1 BINDINGS | |
92 | ||
93 | When a new label is created, it has no default event bindings: | |
94 | labels are not intended to be interactive. | |
95 | ||
96 | =head1 KEYWORDS | |
97 | ||
98 | label, widget | |
99 | ||
100 | =cut | |
101 |