1Message(3) User Contributed Perl Documentation Message(3)
2
3
4
6 Tk::Message - Create and manipulate Message widgets
7
9 $message = $parent->Message(?options?);
10
12 -anchor -font -highlightthickness -takefocus -back‐
13 ground -foreground -padx -text -borderwidth -highlightback‐
14 ground -pady -textvariable -cursor -highlight‐
15 color -relief -width
16
17 See Tk::options for details of the standard options.
18
20 Name: aspect
21 Class: Aspect
22 Switch: -aspect
23 Specifies a non-negative integer value indicating desired aspect
24 ratio for the text. The aspect ratio is specified as
25 100*width/height. 100 means the text should be as wide as it is
26 tall, 200 means the text should be twice as wide as it is tall, 50
27 means the text should be twice as tall as it is wide, and so on.
28 Used to choose line length for text if width option isn't speci‐
29 fied. Defaults to 150.
30
31 Name: justify
32 Class: Justify
33 Switch: -justify
34 Specifies how to justify lines of text. Must be one of left, cen‐
35 ter, or right. Defaults to left. This option works together with
36 the anchor, aspect, padX, padY, and width options to provide a
37 variety of arrangements of the text within the window. The aspect
38 and width options determine the amount of screen space needed to
39 display the text. The anchor, padX, and padY options determine
40 where this rectangular area is displayed within the widget's win‐
41 dow, and the justify option determines how each line is displayed
42 within that rectangular region. For example, suppose anchor is e
43 and justify is left, and that the message window is much larger
44 than needed for the text. The the text will displayed so that the
45 left edges of all the lines line up and the right edge of the long‐
46 est line is padX from the right side of the window; the entire
47 text block will be centered in the vertical span of the window.
48
49 Name: width
50 Class: Width
51 Switch: -width
52 Specifies the length of lines in the window. The value may have
53 any of the forms acceptable to Tk_GetPixels. If this option has a
54 value greater than zero then the aspect option is ignored and the
55 width option determines the line length. If this option has a
56 value less than or equal to zero, then the aspect option determines
57 the line length.
58
60 The Message method creates a new window (given by the $widget argument)
61 and makes it into a message widget. Additional options, described
62 above, may be specified on the command line or in the option database
63 to configure aspects of the message such as its colors, font, text, and
64 initial relief. The message command returns its $widget argument. At
65 the time this command is invoked, there must not exist a window named
66 $widget, but $widget's parent must exist.
67
68 A message is a widget that displays a textual string. A message widget
69 has three special features. First, it breaks up its string into lines
70 in order to produce a given aspect ratio for the window. The line
71 breaks are chosen at word boundaries wherever possible (if not even a
72 single word would fit on a line, then the word will be split across
73 lines). Newline characters in the string will force line breaks; they
74 can be used, for example, to leave blank lines in the display.
75
76 The second feature of a message widget is justification. The text may
77 be displayed left-justified (each line starts at the left side of the
78 window), centered on a line-by-line basis, or right-justified (each
79 line ends at the right side of the window).
80
81 The third feature of a message widget is that it handles control char‐
82 acters and non-printing characters specially. Tab characters are
83 replaced with enough blank space to line up on the next 8-character
84 boundary. Newlines cause line breaks. Other control characters (ASCII
85 code less than 0x20) and characters not defined in the font are dis‐
86 played as a four-character sequence \xhh where hh is the two-digit
87 hexadecimal number corresponding to the character. In the unusual case
88 where the font doesn't contain all of the characters in
89 ``0123456789abcdef\x'' then control characters and undefined characters
90 are not displayed at all.
91
93 The Message method creates a widget object. This object supports the
94 configure and cget methods described in Tk::options which can be used
95 to enquire and modify the options described above. The widget also
96 inherits all the methods provided by the generic Tk::Widget class.
97
99 When a new message is created, it has no default event bindings: mes‐
100 sages are intended for output purposes only.
101
103 Tabs don't work very well with text that is centered or right-justi‐
104 fied. The most common result is that the line is justified wrong.
105
107 message, widget
108
109
110
111perl v5.8.8 2008-02-05 Message(3)