home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / scale.n < prev    next >
Encoding:
Text File  |  1993-04-01  |  8.4 KB  |  260 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/scale.n,v 1.10 93/04/01 09:52:53 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS scale tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. scale \- Create and manipulate scale widgets
  29. .SH SYNOPSIS
  30. \fBscale\fI \fIpathName \fR?\fIoptions\fR?
  31. .SH "STANDARD OPTIONS"
  32. .LP
  33. .nf
  34. .ta 4c 8c 12c
  35. .VS
  36. \fBactiveForeground\fR    \fBborderWidth\fR    \fBfont\fR    \fBorient\fR
  37. \fBbackground\fR    \fBcursor\fR    \fBforeground\fR    \fBrelief\fR
  38. .VE
  39. .fi
  40. .LP
  41. See the ``options'' manual entry for details on the standard options.
  42. .SH "WIDGET-SPECIFIC OPTIONS"
  43. .ta 4c
  44. .LP
  45. .nf
  46. Name:    \fBcommand\fR
  47. Class:    \fBCommand\fR
  48. Command-Line Switch:    \fB\-command\fR
  49. .fi
  50. .IP
  51. Specifies the prefix of a Tcl command to invoke whenever the value of
  52. the scale is changed interactively.  The actual command consists
  53. of this option followed by
  54. a space and a number.  The number indicates the new value of the
  55. scale.
  56. .LP
  57. .nf
  58. Name:    \fBfrom\fR
  59. Class:    \fBFrom\fR
  60. Command-Line Switch:    \fB\-from\fR
  61. .fi
  62. .IP
  63. Specifies the value corresponding to the left or top end of the
  64. scale.  Must be an integer.
  65. .LP
  66. .nf
  67. Name:    \fBlabel\fR
  68. Class:    \fBLabel\fR
  69. Command-Line Switch:    \fB\-label\fR
  70. .fi
  71. .IP
  72. Specifies a string to displayed  as a label for the scale.  For
  73. vertical scales the label is displayed just to the right of the
  74. top end of the scale.  For horizontal scales the label is displayed
  75. just above the left end of the scale.
  76. .LP
  77. .nf
  78. Name:    \fBlength\fR
  79. Class:    \fBLength\fR
  80. Command-Line Switch:    \fB\-length\fR
  81. .fi
  82. .IP
  83. .VS
  84. Specifies the desired long dimension of the scale in screen units
  85. (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
  86. .VE
  87. For vertical scales this is the scale's height;  for horizontal scales
  88. it is the scale's width.
  89. .LP
  90. .nf
  91. Name:    \fBshowValue\fR
  92. Class:    \fBShowValue\fR
  93. Command-Line Switch:    \fB\-showvalue\fR
  94. .fi
  95. .IP
  96. Specifies a boolean value indicating whether or not the current
  97. value of the scale is to be displayed.
  98. .LP
  99. .nf
  100. Name:    \fBsliderForeground\fR
  101. Class:    \fBsliderForeground\fR
  102. Command-Line Switch:    \fB\-sliderforeground\fR
  103. .fi
  104. .IP
  105. Specifies the color to use for drawing the slider under normal conditions.
  106. When the mouse is in the slider window then the slider's color is
  107. determined by the \fBactiveForeground\fR option.
  108. .LP
  109. .nf
  110. Name:    \fBsliderLength\fR
  111. Class:    \fBSliderLength\fR
  112. Command-Line Switch:    \fB\-sliderlength\fR
  113. .fi
  114. .IP
  115. .VS
  116. Specfies the size of the slider, measured in screen units along the slider's
  117. long dimension.  The value may be specified in any of the forms acceptable
  118. to \fBTk_GetPixels\fR.
  119. .LP
  120. .nf
  121. .VS
  122. Name:    \fBstate\fR
  123. Class:    \fBState\fR
  124. Command-Line Switch:    \fB\-state\fR
  125. .fi
  126. .IP
  127. Specifies one of two states for the scale:  \fBnormal\fR or \fBdisabled\fR.
  128. If the scale is disabled then the value may not be changed and the scale
  129. won't activate when the mouse enters it.
  130. .VE
  131. .LP
  132. .nf
  133. Name:    \fBtickInterval\fR
  134. Class:    \fBTickInterval\fR
  135. Command-Line Switch:    \fB\-tickinterval\fR
  136. .fi
  137. .IP
  138. Must be an integer value.  Determines the spacing between numerical
  139. tick-marks displayed below or to the left of the slider.  If specified
  140. as 0, then no tick-marks will be displayed.
  141. .LP
  142. .nf
  143. Name:    \fBto\fR
  144. Class:    \fBTo\fR
  145. Command-Line Switch:    \fB\-to\fR
  146. .fi
  147. .IP
  148. Specifies the value corresponding to the right or bottom end of the
  149. scale.  Must be an integer.  This value may be either less than or
  150. greater than the \fBfrom\fR option.
  151. .LP
  152. .nf
  153. Name:    \fBwidth\fR
  154. Class:    \fBWidth\fR
  155. Command-Line Switch:    \fB\-width\fR
  156. .fi
  157. .IP
  158. .VS
  159. Specifies the desired narrow dimension of the scale in screen units
  160. (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
  161. .VE
  162. For vertical scales this is the scale's width;  for horizontal scales
  163. this is the scale's height.
  164. .BE
  165.  
  166. .SH DESCRIPTION
  167. .PP
  168. The \fBscale\fR command creates a new window (given by the
  169. \fIpathName\fR argument) and makes it into a scale widget.
  170. Additional
  171. options, described above, may be specified on the command line
  172. or in the option database
  173. to configure aspects of the scale such as its colors, orientation,
  174. and relief.  The \fBscale\fR command returns its
  175. \fIpathName\fR argument.  At the time this command is invoked,
  176. there must not exist a window named \fIpathName\fR, but
  177. \fIpathName\fR's parent must exist.
  178. .PP
  179. A scale is a widget that displays a rectangular region and a
  180. small \fIslider\fR.  The rectangular region corresponds to a range
  181. of integer values (determined by the \fBfrom\fR and \fBto\fR options),
  182. and the position of the slider selects a particular integer value.
  183. The slider's position (and hence the scale's value) may be adjusted
  184. by clicking or dragging with the mouse as described in the BINDINGS
  185. section below.  Whenever the scale's value is changed, a Tcl
  186. command is invoked (using the \fBcommand\fR option) to notify
  187. other interested widgets of the change.
  188. .PP
  189. Three annotations may be displayed in a scale widget:  a label
  190. appearing at the top-left of the widget (top-right for vertical
  191. scales), a number displayed just underneath the slider
  192. (just to the left of the slider for vertical scales), and a collection
  193. of numerical tick-marks just underneath the current value (just to the left of
  194. the current value for vertical scales).  Each of these three
  195. annotations may be selectively enabled or disabled using the
  196. configuration options.
  197.  
  198. .SH "WIDGET COMMAND"
  199. .PP
  200. The \fBscale\fR command creates a new Tcl command whose
  201. name is \fIpathName\fR.  This
  202. command may be used to invoke various
  203. operations on the widget.  It has the following general form:
  204. .DS C
  205. \fIpathName option \fR?\fIarg arg ...\fR?
  206. .DE
  207. \fIOption\fR and the \fIarg\fRs
  208. determine the exact behavior of the command.  The following
  209. commands are possible for scale widgets:
  210. .TP
  211. \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
  212. Query or modify the configuration options of the widget.
  213. If no \fIoption\fR is specified, returns a list describing all of
  214. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  215. information on the format of this list).  If \fIoption\fR is specified
  216. with no \fIvalue\fR, then the command returns a list describing the
  217. one named option (this list will be identical to the corresponding
  218. sublist of the value returned if no \fIoption\fR is specified).  If
  219. one or more \fIoption\-value\fR pairs are specified, then the command
  220. modifies the given widget option(s) to have the given value(s);  in
  221. this case the command returns an empty string.
  222. \fIOption\fR may have any of the values accepted by the \fBscale\fR
  223. command.
  224. .TP
  225. \fIpathName \fBget\fR
  226. Returns a decimal string giving the current value of the scale.
  227. .TP
  228. \fIpathName \fBset\fR \fIvalue\fR
  229. This command is invoked to change the current value of the scale,
  230. and hence the position at which the slider is displayed.  \fIValue\fR
  231. gives the new value for the scale.
  232.  
  233. .SH BINDINGS
  234. .PP
  235. When a new scale is created, it is given the following initial
  236. behavior by default:
  237. .TP 20
  238. \fB<Enter>\fR
  239. Change the slider display to use \fBactiveForeground\fR instead of
  240. \fBsliderForeground\fR.
  241. .TP 20
  242. \fB<Leave>\fR
  243. Reset the slider display to use \fBsliderForeground\fR instead of
  244. \fBactiveForeground\fR.
  245. .TP 20
  246. \fB<ButtonPress-1>\fR
  247. Change the slider display so that the slider appears sunken rather
  248. than raised.  Move the slider (and adjust the scale's value)
  249. to correspond to the current mouse position.
  250. .TP 20
  251. \fB<Button1-Motion>\fR
  252. Move the slider (and adjust the scale's value) to correspond to
  253. the current mouse position.
  254. .TP 20
  255. \fB<ButtonRelease-1>\fR
  256. Reset the slider display so that the slider appears raised again.
  257.  
  258. .SH KEYWORDS
  259. scale, widget
  260.