home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / scrollbar.n < prev    next >
Encoding:
Text File  |  1993-04-01  |  8.3 KB  |  203 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/scrollbar.n,v 1.10 93/04/01 09:52:54 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS scrollbar tk
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. scrollbar \- Create and manipulate scrollbar widgets
  29. .SH SYNOPSIS
  30. \fBscrollbar\fI pathName \fR?\fIoptions\fR?
  31. .SH "STANDARD OPTIONS"
  32. .LP
  33. .nf
  34. .ta 4c 8c 12c
  35. .VS
  36. \fBactiveForeground\fR    \fBcursor\fR    \fBrelief\fR
  37. .VE
  38. \fBbackground\fR    \fBforeground\fR    \fBrepeatDelay\fR
  39. \fBborderWidth\fR    \fBorient\fR    \fBrepeatInterval\fR
  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:    \fBcommand\fR
  48. Class:    \fBCommand\fR
  49. Command-Line Switch:    \fB\-command\fR
  50. .fi
  51. .IP
  52. Specifies the prefix of a Tcl command to invoke to change the view
  53. in the widget associated with the scrollbar.  When a user requests
  54. a view change by manipulating the scrollbar, a Tcl command is
  55. invoked.  The actual command consists of this option followed by
  56. a space and a number.  The number indicates the logical unit that
  57. should appear at the top of the associated window.
  58. .LP
  59. .nf
  60. Name:    \fBwidth\fR
  61. Class:    \fBWidth\fR
  62. Command-Line Switch:    \fB\-width\fR
  63. .fi
  64. .IP
  65. Specifies the desired narrow dimension of the scrollbar window,
  66. not including 3-D border, if any.  For vertical
  67. scrollbars this will be the width and for horizontal scrollbars
  68. this will be the height.
  69. .VS
  70. The value may have any of the forms acceptable to \fBTk_GetPixels\fR.
  71. .VE
  72. .BE
  73.  
  74. .SH DESCRIPTION
  75. .PP
  76. The \fBscrollbar\fR command creates a new window (given by the
  77. \fIpathName\fR argument) and makes it into a scrollbar widget.
  78. Additional
  79. options, described above, may be specified on the command line
  80. or in the option database
  81. to configure aspects of the scrollbar such as its colors, orientation,
  82. and relief.  The \fBscrollbar\fR command returns its
  83. \fIpathName\fR argument.  At the time this command is invoked,
  84. there must not exist a window named \fIpathName\fR, but
  85. \fIpathName\fR's parent must exist.
  86. .PP
  87. A scrollbar is a widget that displays two arrows, one at each end of
  88. the scrollbar, and a \fIslider\fR in the middle portion of the
  89. scrollbar.  A scrollbar is used to provide information about what
  90. is visible in an \fIassociated window\fR that displays an object
  91. of some sort (such as a file being edited or a drawing).
  92. The position and size of the slider indicate which portion of the
  93. object is visible in the associated window.  For example, if the
  94. slider in a vertical scrollbar covers the top third of the area
  95. between the two arrows, it means that the associated window displays
  96. the top third of its object.
  97. .PP
  98. Scrollbars can be used to adjust the view in the associated window
  99. by clicking or dragging with the mouse.  See the BINDINGS section
  100. below for details.
  101.  
  102. .SH "WIDGET COMMAND"
  103. .PP
  104. The \fBscrollbar\fR command creates a new Tcl command whose
  105. name is \fIpathName\fR.  This
  106. command may be used to invoke various
  107. operations on the widget.  It has the following general form:
  108. .DS C
  109. \fIpathName option \fR?\fIarg arg ...\fR?
  110. .DE
  111. \fIOption\fR and the \fIarg\fRs
  112. determine the exact behavior of the command.  The following
  113. commands are possible for scrollbar widgets:
  114. .TP
  115. \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
  116. Query or modify the configuration options of the widget.
  117. If no \fIoption\fR is specified, returns a list describing all of
  118. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  119. information on the format of this list).  If \fIoption\fR is specified
  120. with no \fIvalue\fR, then the command returns a list describing the
  121. one named option (this list will be identical to the corresponding
  122. sublist of the value returned if no \fIoption\fR is specified).  If
  123. one or more \fIoption\-value\fR pairs are specified, then the command
  124. modifies the given widget option(s) to have the given value(s);  in
  125. this case the command returns an empty string.
  126. \fIOption\fR may have any of the values accepted by the \fBscrollbar\fR
  127. command.
  128. .TP
  129. \fIpathName \fBget\fR
  130. Returns a Tcl list containing four decimal values, which are
  131. the current \fItotalUnits\fR, \fIwidnowUnits\fR, \fIfirstUnit\fR,
  132. and \fIlastUnit\fR values for the scrollbar.  These are the values
  133. from the most recent \fBset\fR widget command on the scrollbar.
  134. .TP
  135. \fIpathName \fBset\fR \fItotalUnits windowUnits firstUnit lastUnit\fR
  136. This command is invoked to give the scrollbar information about the
  137. widget associated with the scrollbar.  \fITotalUnits\fR is an integer
  138. value giving the total size of the object being displayed in the
  139. associated widget.  The meaning of one unit depends on the associated
  140. widget;  for example, in a text editor widget units might
  141. correspond to lines of
  142. text.  \fIWindowUnits\fR indicates the total number of units that
  143. can fit in the associated window at one time.  \fIFirstUnit\fR
  144. and \fIlastUnit\fR give the indices of the first and last units
  145. currently visible in the associated window (zero corresponds to the
  146. first unit of the object).  This command should
  147. be invoked by the associated widget whenever its object or window
  148. changes size and whenever it changes the view in its window.
  149.  
  150. .SH BINDINGS
  151. .PP
  152. The description below assumes a vertically-oriented scrollbar.
  153. For a horizontally-oriented scrollbar replace the words ``up'', ``down'',
  154. ``top'', and ``bottom'' with ``left'', ``right'', ``left'',
  155. and ``right'', respectively
  156. .PP
  157. A scrollbar widget is divided into five distinct areas.  From top
  158. to bottom, they are:  the top arrow, the top gap (the empty space
  159. between the arrow and the slider), the slider, the bottom gap,
  160. and the bottom arrow.  Pressing mouse button 1 in each area has
  161. a different effect:
  162. .TP 20
  163. \fBtop arrow\fR
  164. Causes the view in the associated window to shift up by one unit
  165. (i.e. the object appears to move down one unit in its window).
  166. If the button is held down the action will auto-repeat.
  167. .TP 20
  168. \fBtop gap\fR
  169. Causes the view in the associated window to shift up by one
  170. less than the number of units in the window
  171. (i.e. the portion of the object that used to appear at the very
  172. top of the window will now appear at the very bottom).
  173. If the button is held down the action will auto-repeat.
  174. .TP 20
  175. \fBslider\fR
  176. Pressing button 1 in this area has no immediate effect except to
  177. cause the slider to appear sunken rather than raised.  However,
  178. if the mouse is moved with the button down then the slider will
  179. be dragged, adjusting the view as the mouse is moved.
  180. .TP 20
  181. \fBbottom gap\fR
  182. Causes the view in the associated window to shift down by one
  183. less than the number of units in the window
  184. (i.e. the portion of the object that used to appear at the very
  185. bottom of the window will now appear at the very top).
  186. If the button is held down the action will auto-repeat.
  187. .TP 20
  188. \fBbottom arrow\fR
  189. Causes the view in the associated window to shift down by one unit
  190. (i.e. the object appears to move up one unit in its window).
  191. If the button is held down the action will auto-repeat.
  192. .PP
  193. Note:  none of the actions described above has an immediate impact
  194. on the position of the slider in the scrollbar.  It simply invokes
  195. the command specified in the \fBcommand\fR option to notify the
  196. associated widget that a change in view is desired.  If the view is
  197. actually changed then the associated widget must invoke the
  198. scrollbar's \fBset\fR widget command to change what is displayed in
  199. the scrollbar.
  200.  
  201. .SH KEYWORDS
  202. scrollbar, widget
  203.