OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/base.git] / util / src / TclTk / tk8.6.12 / doc / GetScroll.3
1 '\"
2 '\" Copyright (c) 1994 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\"
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\"
8 .TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
9 .so man.macros
10 .BS
11 .SH NAME
12 Tk_GetScrollInfoObj, Tk_GetScrollInfo \- parse arguments for scrolling commands
13 .SH SYNOPSIS
14 .nf
15 \fB#include <tk.h>\fR
16 .sp
17 int
18 \fBTk_GetScrollInfoObj(\fIinterp, objc, objv, fractionPtr, stepsPtr\fB)\fR
19 .sp
20 int
21 \fBTk_GetScrollInfo(\fIinterp, argc, argv, fractionPtr, stepsPtr\fB)\fR
22 .SH ARGUMENTS
23 .AS "Tcl_Interp" *fractionPtr
24 .AP Tcl_Interp *interp in
25 Interpreter to use for error reporting.
26 .AP int objc in
27 Number of Tcl_Obj's in \fIobjv\fR array.
28 .AP "Tcl_Obj *const *" objv in
29 Argument objects.  These represent the entire widget command, of
30 which the first word is typically the widget name and the second
31 word is typically \fBxview\fR or \fByview\fR.
32 .AP int argc in
33 Number of strings in \fIargv\fR array.
34 .AP "const char **" argv in
35 Argument strings.  These represent the entire widget command, of
36 which the first word is typically the widget name and the second
37 word is typically \fBxview\fR or \fByview\fR.
38 .AP double *fractionPtr out
39 Filled in with fraction from \fBmoveto\fR option, if any.
40 .AP int *stepsPtr out
41 Filled in with line or page count from \fBscroll\fR option, if any.
42 The value may be negative.
43 .BE
44 .SH DESCRIPTION
45 .PP
46 \fBTk_GetScrollInfoObj\fR parses the arguments expected by widget
47 scrolling commands such as \fBxview\fR and \fByview\fR.
48 It receives the entire list of words that make up a widget command
49 and parses the words starting with \fIobjv\fR[2].
50 The words starting with \fIobjv\fR[2] must have one of the following forms:
51 .CS
52 \fBmoveto \fIfraction\fR
53 \fBscroll \fInumber\fB units\fR
54 \fBscroll \fInumber\fB pages\fR
55 .CE
56 .LP
57 Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR
58 keywords may be abbreviated.
59 If \fIobjv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
60 is returned as result and \fI*fractionPtr\fR is filled in with the
61 \fIfraction\fR argument to the command, which must be a proper real
62 value.
63 If \fIobjv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
64 or \fBTK_SCROLL_PAGES\fR is returned and \fI*stepsPtr\fR is filled
65 in with the \fInumber\fR value, which must be a proper integer.
66 If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR
67 is returned and an error message is left in interpreter
68 \fIinterp\fR's result.
69 .PP
70 \fBTk_GetScrollInfo\fR is identical in function to
71 \fBTk_GetScrollInfoObj\fR.  However, \fBTk_GetScrollInfo\fR accepts
72 string arguments, making it more appropriate for use with legacy
73 widgets.
74 .SH KEYWORDS
75 parse, scrollbar, scrolling command, xview, yview