1Label(3) User Contributed Perl Documentation Label(3)
2
3
4
6 Tk::Label - Create and manipulate Label widgets
7
9 $label = $parent->Label(?options?);
10
12 -activebackground -activeforeground -anchor -background -bitmap
13 -borderwidth -compound -cursor -disabledforeground -font -foreground
14 -highlightbackground -highlightcolor -highlightthickness -image
15 -justify -padx -pady -relief -takefocus -text -textvariable -underline
16 -wraplength
17
18 See Tk::options for details of the standard options.
19
21 Name: height
22 Class: Height
23 Switch: -height
24 Specifies a desired height for the label. If an image or bitmap is
25 being displayed in the label then the value is in screen units
26 (i.e. any of the forms acceptable to Tk_GetPixels); for text it is
27 in lines of text. If this option isn't specified, the label's
28 desired height is computed from the size of the image or bitmap or
29 text being displayed in it.
30
31 Name: state
32 Class: State
33 Switch: -state
34 Specifies one of three states for the label: normal, active, or
35 disabled. In normal state the label is displayed using the
36 foreground and background options. In active state the label is
37 displayed using the activeForeground and activeBackground options.
38 In the disabled state the disabledForeground and background options
39 determine how the button is displayed.
40
41 Name: width
42 Class: Width
43 Switch: -width
44 Specifies a desired width for the label. If an image or bitmap is
45 being displayed in the label then the value is in screen units
46 (i.e. any of the forms acceptable to Tk_GetPixels); for text it is
47 in characters. If this option isn't specified, the label's desired
48 width is computed from the size of the image or bitmap or text
49 being displayed in it.
50
52 The Label method creates a new window (given by the $widget argument)
53 and makes it into a label widget. Additional options, described above,
54 may be specified on the command line or in the option database to
55 configure aspects of the label such as its colors, font, text, and
56 initial relief. The label command returns its $widget argument. At
57 the time this command is invoked, there must not exist a window named
58 $widget, but $widget's parent must exist.
59
60 A label is a widget that displays a textual string, bitmap or image.
61 If text is displayed, it must all be in a single font, but it can
62 occupy multiple lines on the screen (if it contains newlines or if
63 wrapping occurs because of the wrapLength option) and one of the
64 characters may optionally be underlined using the underline option.
65 The label can be manipulated in a few simple ways, such as changing its
66 relief or text, using the commands described below.
67
69 The Label method creates a widget object. This object supports the
70 configure and cget methods described in Tk::options which can be used
71 to enquire and modify the options described above. The widget also
72 inherits all the methods provided by the generic Tk::Widget class.
73
75 When a new label is created, it has no default event bindings: labels
76 are not intended to be interactive.
77
79 label, widget
80
81
82
83perl v5.38.0 2023-07-21 Label(3)