home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / message.n < prev    next >
Encoding:
Text File  |  1993-04-01  |  7.1 KB  |  186 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/message.n,v 1.17 93/04/01 09:52:47 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS message tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. message \- Create and manipulate message widgets
  29. .SH SYNOPSIS
  30. \fBmessage\fI \fIpathName \fR?\fIoptions\fR?
  31. .SH "STANDARD OPTIONS"
  32. .LP
  33. .nf
  34. .ta 4c 8c 12c
  35. .VS
  36. \fBanchor\fR    \fBcursor\fR    \fBpadX\fR    \fBtext\fR
  37. \fBbackground\fR    \fBfont\fR    \fBpadY\fR    \fBtextVariable\fR
  38. \fBborderWidth\fR    \fBforeground\fR    \fBrelief\fR    \fBwidth\fR
  39. .VE
  40. .fi
  41. .LP
  42. See the ``options'' manual entry for details on the standard options.
  43. .SH "WIDGET-SPECIFIC OPTIONS"
  44. .ta 4c
  45. .LP
  46. .nf
  47. Name:    \fBaspect\fR
  48. Class:    \fBAspect\fR
  49. Command-Line Switch:    \fB\-aspect\fR
  50. .fi
  51. .IP
  52. Specifies a non-negative integer value indicating desired
  53. aspect ratio for the text.  The aspect ratio is specified as
  54. 100*width/height.  100 means the text should
  55. be as wide as it is tall, 200 means the text should
  56. be twice as wide as it is tall, 50 means the text should
  57. be twice as tall as it is wide, and so on.
  58. .VS
  59. Used to choose line length for text if \fBwidth\fR option
  60. isn't specified.
  61. .VE
  62. Defaults to 150.
  63. .LP
  64. .nf
  65. Name:    \fBjustify\fR
  66. Class:    \fBJustify\fR
  67. Command-Line Switch:    \fB\-justify\fR
  68. .fi
  69. .IP
  70. Specifies how to justify lines of text.
  71. Must be one of \fBleft\fR, \fBcenter\fR, or \fBright\fR.  Defaults
  72. to \fBleft\fR.
  73. .VS
  74. This option works together with the \fBanchor\fR, \fBaspect\fR,
  75. \fBpadX\fR, \fBpadY\fR, and \fBwidth\fR options to provide a variety
  76. of arrangements of the text within the window.
  77. The \fBaspect\fR and \fBwidth\fR options determine the amount of
  78. screen space needed to display the text.
  79. The \fBanchor\fR, \fBpadX\fR, and \fBpadY\fR options determine where this
  80. rectangular area is displayed within the widget's window, and the
  81. \fBjustify\fR option determines how each line is displayed within that
  82. rectangular region.
  83. For example, suppose \fBanchor\fR is \fBe\fR and \fBjustify\fR is
  84. \fBleft\fR, and that the message window is much larger than needed
  85. for the text.
  86. The the text will displayed so that the left edges of all the lines
  87. line up and the right edge of the longest line is \fBpadX\fR from
  88. the right side of the window;  the entire text block will be centered
  89. in the vertical span of the window.
  90. .VE
  91. .LP
  92. .nf
  93. .VS
  94. Name:    \fBwidth\fR
  95. Class:    \fBWidth\fR
  96. Command-Line Switch:    \fB\-width\fR
  97. .fi
  98. .IP
  99. Specifies the length of lines in the window.
  100. The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
  101. If this option has a value greater than zero then the \fBaspect\fR
  102. option is ignored and the \fBwidth\fR option determines the line
  103. length.
  104. If this option has a value less than or equal to zero, then
  105. the \fBaspect\fR option determines the line length.
  106. .VE
  107. .BE
  108.  
  109. .SH DESCRIPTION
  110. .PP
  111. The \fBmessage\fR command creates a new window (given by the
  112. \fIpathName\fR argument) and makes it into a message widget.
  113. Additional
  114. options, described above, may be specified on the command line
  115. or in the option database
  116. to configure aspects of the message such as its colors, font,
  117. text, and initial relief.  The \fBmessage\fR command returns its
  118. \fIpathName\fR argument.  At the time this command is invoked,
  119. there must not exist a window named \fIpathName\fR, but
  120. \fIpathName\fR's parent must exist.
  121. .PP
  122. A message is a widget that displays a textual string.  A message
  123. widget has three special features.  First, it breaks up
  124. its string into lines in order to produce a given aspect ratio
  125. for the window.  The line breaks are chosen at word boundaries
  126. wherever possible (if not even a single word would fit on a
  127. line, then the word will be split across lines).  Newline characters
  128. in the string will force line breaks;  they can be used, for example,
  129. to leave blank lines in the display.
  130. .PP
  131. The second feature of a message widget is justification.  The text
  132. may be displayed left-justified (each line starts at the left side of
  133. the window), centered on a line-by-line basis, or right-justified
  134. (each line ends at the right side of the window).
  135. .PP
  136. The third feature of a message widget is that it handles control
  137. characters and non-printing characters specially.  Tab characters
  138. are replaced with enough blank space to line up on the next
  139. 8-character boundary.  Newlines cause line breaks.  Other control
  140. characters (ASCII code less than 0x20) and characters not defined
  141. in the font are displayed as a four-character sequence \fB\ex\fIhh\fR where
  142. \fIhh\fR is the two-digit hexadecimal number corresponding to
  143. the character.  In the unusual case where the font doesn't contain
  144. all of the characters in ``0123456789abcdef\ex'' then control
  145. characters and undefined characters are not displayed at all.
  146.  
  147. .SH "WIDGET COMMAND"
  148. .PP
  149. The \fBmessage\fR command creates a new Tcl command whose
  150. name is \fIpathName\fR.  This
  151. command may be used to invoke various
  152. operations on the widget.  It has the following general form:
  153. .DS C
  154. \fIpathName option \fR?\fIarg arg ...\fR?
  155. .DE
  156. \fIOption\fR and the \fIarg\fRs
  157. determine the exact behavior of the command.  The following
  158. commands are possible for message widgets:
  159. .TP
  160. \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
  161. Query or modify the configuration options of the widget.
  162. If no \fIoption\fR is specified, returns a list describing all of
  163. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  164. information on the format of this list).  If \fIoption\fR is specified
  165. with no \fIvalue\fR, then the command returns a list describing the
  166. one named option (this list will be identical to the corresponding
  167. sublist of the value returned if no \fIoption\fR is specified).  If
  168. one or more \fIoption\-value\fR pairs are specified, then the command
  169. modifies the given widget option(s) to have the given value(s);  in
  170. this case the command returns an empty string.
  171. \fIOption\fR may have any of the values accepted by the \fBmessage\fR
  172. command.
  173.  
  174. .SH "DEFAULT BINDINGS"
  175. .PP
  176. When a new message is created, it has no default event bindings:
  177. messages are intended for output purposes only.
  178.  
  179. .SH BUGS
  180. .PP
  181. Tabs don't work very well with text that is centered or right-justified.
  182. The most common result is that the line is justified wrong.
  183.  
  184. .SH KEYWORDS
  185. message, widget
  186.