Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / sun4-solaris / Tk / Message.pod
CommitLineData
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
10Tk::Message - Create and manipulate Message widgets
11
12=for category Tk Widget Classes
13
14=head1 SYNOPSIS
15
16I<$message> = I<$parent>-E<gt>B<Message>(?I<options>?);
17
18=head1 STANDARD OPTIONS
19
20B<-anchor> B<-font> B<-highlightthickness> B<-takefocus>
21B<-background> B<-foreground> B<-padx> B<-text>
22B<-borderwidth> B<-highlightbackground> B<-pady> B<-textvariable>
23B<-cursor> B<-highlightcolor> B<-relief> B<-width>
24
25See L<Tk::options> for details of the standard options.
26
27=head1 WIDGET-SPECIFIC OPTIONS
28
29=over 4
30
31=item Name: B<aspect>
32
33=item Class: B<Aspect>
34
35=item Switch: B<-aspect>
36
37Specifies a non-negative integer value indicating desired
38aspect ratio for the text. The aspect ratio is specified as
39100*width/height. 100 means the text should
40be as wide as it is tall, 200 means the text should
41be twice as wide as it is tall, 50 means the text should
42be twice as tall as it is wide, and so on.
43Used to choose line length for text if B<width> option
44isn't specified.
45Defaults to 150.
46
47=item Name: B<justify>
48
49=item Class: B<Justify>
50
51=item Switch: B<-justify>
52
53Specifies how to justify lines of text.
54Must be one of B<left>, B<center>, or B<right>. Defaults
55to B<left>.
56This option works together with the B<anchor>, B<aspect>,
57B<padX>, B<padY>, and B<width> options to provide a variety
58of arrangements of the text within the window.
59The B<aspect> and B<width> options determine the amount of
60screen space needed to display the text.
61The B<anchor>, B<padX>, and B<padY> options determine where this
62rectangular area is displayed within the widget's window, and the
63B<justify> option determines how each line is displayed within that
64rectangular region.
65For example, suppose B<anchor> is B<e> and B<justify> is
66B<left>, and that the message window is much larger than needed
67for the text.
68The the text will displayed so that the left edges of all the lines
69line up and the right edge of the longest line is B<padX> from
70the right side of the window; the entire text block will be centered
71in the vertical span of the window.
72
73=item Name: B<width>
74
75=item Class: B<Width>
76
77=item Switch: B<-width>
78
79Specifies the length of lines in the window.
80The value may have any of the forms acceptable to B<Tk_GetPixels>.
81If this option has a value greater than zero then the B<aspect>
82option is ignored and the B<width> option determines the line
83length.
84If this option has a value less than or equal to zero, then
85the B<aspect> option determines the line length.
86
87=back
88
89=head1 DESCRIPTION
90
91The B<Message> method creates a new window (given by the
92$widget argument) and makes it into a message widget.
93Additional
94options, described above, may be specified on the command line
95or in the option database
96to configure aspects of the message such as its colors, font,
97text, and initial relief. The B<message> command returns its
98$widget argument. At the time this command is invoked,
99there must not exist a window named $widget, but
100$widget's parent must exist.
101
102A message is a widget that displays a textual string. A message
103widget has three special features. First, it breaks up
104its string into lines in order to produce a given aspect ratio
105for the window. The line breaks are chosen at word boundaries
106wherever possible (if not even a single word would fit on a
107line, then the word will be split across lines). Newline characters
108in the string will force line breaks; they can be used, for example,
109to leave blank lines in the display.
110
111The second feature of a message widget is justification. The text
112may be displayed left-justified (each line starts at the left side of
113the window), centered on a line-by-line basis, or right-justified
114(each line ends at the right side of the window).
115
116The third feature of a message widget is that it handles control
117characters and non-printing characters specially. Tab characters
118are replaced with enough blank space to line up on the next
1198-character boundary. Newlines cause line breaks. Other control
120characters (ASCII code less than 0x20) and characters not defined
121in the font are displayed as a four-character sequence B<\x>I<hh> where
122I<hh> is the two-digit hexadecimal number corresponding to
123the character. In the unusual case where the font doesn't contain
124all of the characters in ``0123456789abcdef\x'' then control
125characters and undefined characters are not displayed at all.
126
127=head1 WIDGET METHODS
128
129The B<Message> method creates a widget object.
130This object supports the B<configure> and B<cget> methods
131described in L<Tk::options> which can be used to enquire and
132modify the options described above.
133The widget also inherits all the methods provided by the generic
134L<Tk::Widget|Tk::Widget> class.
135
136=head1 DEFAULT BINDINGS
137
138When a new message is created, it has no default event bindings:
139messages are intended for output purposes only.
140
141=head1 BUGS
142
143Tabs don't work very well with text that is centered or right-justified.
144The most common result is that the line is justified wrong.
145
146=head1 KEYWORDS
147
148message, widget
149
150=cut
151