summaryrefslogtreecommitdiffstats
path: root/doc/GetScroll.3
blob: 6e7acc85092aa50ba5e0e3eaaa5f0e5bf461e38c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
'\"
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: GetScroll.3,v 1.3 2000/04/25 17:25:27 ericm Exp $
'\" 
.so man.macros
.TH Tk_GetScrollInfo 3 8.0 Tk "Tk Library Procedures"
.BS
.SH NAME
Tk_GetScrollInfo, Tk_GetScrollInfoObj \- parse arguments for scrolling commands
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
int
\fBTk_GetScrollInfo(\fIinterp, argc, argv, dblPtr, intPtr\fB)\fR
.sp
int
\fBTk_GetScrollInfoObj(\fIinterp, objc, objv, dblPtr, intPtr\fB)\fR
.SH ARGUMENTS
.AS "Tcl_Interp" *dblPtr
.AP Tcl_Interp *interp in
Interpreter to use for error reporting.
.AP int argc in
Number of strings in \fIargv\fR array.
.AP char *argv[] in
Argument strings.  These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
.AP int objc in
Number of Tcl_Obj's in \fIobjv\fR array.
.AP Tcl_Obj *CONST objv[] in
Argument objects.  These represent the entire widget command, of
which the first word is typically the widget name and the second
word is typically \fBxview\fR or \fByview\fR.
.AP double *dblPtr out
Filled in with fraction from \fBmoveto\fR option, if any.
.AP int *intPtr out
Filled in with line or page count from \fBscroll\fR option, if any.
The value may be negative.
.BE

.SH DESCRIPTION
.PP
\fBTk_GetScrollInfo\fR parses the arguments expected by widget
scrolling commands such as \fBxview\fR and \fByview\fR.
It receives the entire list of words that make up a widget command
and parses the words starting with \fIargv\fR[2].
The words starting with \fIargv\fR[2] must have one of the following forms:
.CS
\fBmoveto \fIfraction\fR
\fBscroll \fInumber\fB units\fR
\fBscroll \fInumber\fB pages\fR
.CE
.LP
Any of the \fBmoveto\fR, \fBscroll\fR, \fBunits\fR, and \fBpages\fR
keywords may be abbreviated.
If \fIargv\fR has the \fBmoveto\fR form, \fBTK_SCROLL_MOVETO\fR
is returned as result and \fI*dblPtr\fR is filled in with the
\fIfraction\fR argument to the command, which must be a proper real
value.
If \fIargv\fR has the \fBscroll\fR form, \fBTK_SCROLL_UNITS\fR
or \fBTK_SCROLL_PAGES\fR is returned and \fI*intPtr\fR is filled
in with the \fInumber\fR value, which must be a proper integer.
If an error occurs in parsing the arguments, \fBTK_SCROLL_ERROR\fR
is returned and an error message is left in \fIinterp->result\fR.
.PP
\fBTk_GetScrollInfoObj\fR is identical in function to
\fBTk_GetScrollInfo\fR.  However, \fBTk_GetScrollInfoObj\fR accepts
Tcl_Obj style arguments, making it more appropriate for use with new
development.

.SH KEYWORDS
parse, scrollbar, scrolling command, xview, yview