Debian Codegraph @

pod/pTk/GetScroll.pod

raw
1 # Copyright (c) 1994 The Regents of the University of California.
2 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
3 # See the file "license.terms" for information on usage and redistribution
4 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
5 #
6 #
7
8 =head1 NAME
9
10 Tk_GetScrollInfo - parse arguments for scrolling commands
11
12 =for category C Programming
13
14 =head1 SYNOPSIS
15
16 B<#include E<lt>tk.hE<gt>>
17
18 int
19 B<Tk_GetScrollInfo(>I<interp, argc, argv, dblPtr, intPtr>B<)>
20
21 =head1 ARGUMENTS
22
23 =over 4
24
25 =item Tcl_Interp *interp (in)
26
27 Interpreter to use for error reporting.
28
29 =item int argc (in)
30
31 Number of strings in I<argv> array.
32
33 =item char *argv[] (in)
34
35 Argument strings. These represent the entire method, of
36 which the first word is typically the widget name and the second
37 word is typically B<xview> or B<yview>. This procedure parses
38 arguments starting with I<argv>[2].
39
40 =item double *dblPtr (out)
41
42 Filled in with fraction from B<moveto> option, if any.
43
44 =item int *intPtr (out)
45
46 Filled in with line or page count from B<scroll> option, if any.
47 The value may be negative.
48
49 =back
50
51 =head1 DESCRIPTION
52
53 B<Tk_GetScrollInfo> parses the arguments expected by widget
54 scrolling commands such as B<xview> and B<yview>.
55 It receives the entire list of words that make up a method
56 and parses the words starting with I<argv>[2].
57 The words starting with I<argv>[2] must have one of the following forms:
58
59 moveto fraction
60 scroll number units
61 scroll number pages
62
63 Any of the B<moveto>, B<scroll>, B<units>, and B<pages>
64 keywords may be abbreviated.
65 If I<argv> has the B<moveto> form, B<TK_SCROLL_MOVETO>
66 is returned as result and I<*dblPtr> is filled in with the
67 I<fraction> argument to the command, which must be a proper real
68 value.
69 If I<argv> has the B<scroll> form, B<TK_SCROLL_UNITS>
70 or B<TK_SCROLL_PAGES> is returned and I<*intPtr> is filled
71 in with the I<number> value, which must be a proper integer.
72 If an error occurs in parsing the arguments, B<TK_SCROLL_ERROR>
73 is returned and an error message is left in I<interp-E<gt>result>.
74
75 =head1 KEYWORDS
76
77 parse, scrollbar, scrolling command, xview, yview