1Tk_GetScrollInfo(3) Tk Library Procedures Tk_GetScrollInfo(3)
2
3
4
5______________________________________________________________________________
6
8 Tk_GetScrollInfo, Tk_GetScrollInfoObj - parse arguments for scrolling
9 commands
10
12 #include <tk.h>
13
14 int
15 Tk_GetScrollInfo(interp, argc, argv, dblPtr, intPtr)
16
17 int
18 Tk_GetScrollInfoObj(interp, objc, objv, dblPtr, intPtr)
19
21 Tcl_Interp *interp (in) Interpreter to use for error report‐
22 ing.
23
24 int argc (in) Number of strings in argv array.
25
26 const char *argv[] (in) Argument strings. These represent the
27 entire widget command, of which the
28 first word is typically the widget
29 name and the second word is typically
30 xview or yview.
31
32 int objc (in) Number of Tcl_Obj's in objv array.
33
34 Tcl_Obj *const objv[] (in) Argument objects. These represent the
35 entire widget command, of which the
36 first word is typically the widget
37 name and the second word is typically
38 xview or yview.
39
40 double *dblPtr (out) Filled in with fraction from moveto
41 option, if any.
42
43 int *intPtr (out) Filled in with line or page count from
44 scroll option, if any. The value may
45 be negative.
46_________________________________________________________________
47
48
50 Tk_GetScrollInfo parses the arguments expected by widget scrolling com‐
51 mands such as xview and yview. It receives the entire list of words
52 that make up a widget command and parses the words starting with
53 argv[2]. The words starting with argv[2] must have one of the follow‐
54 ing forms:
55 moveto fraction
56 scroll number units
57 scroll number pages
58
59 Any of the moveto, scroll, units, and pages keywords may be abbrevi‐
60 ated. If argv has the moveto form, TK_SCROLL_MOVETO is returned as
61 result and *dblPtr is filled in with the fraction argument to the com‐
62 mand, which must be a proper real value. If argv has the scroll form,
63 TK_SCROLL_UNITS or TK_SCROLL_PAGES is returned and *intPtr is filled in
64 with the number value, which must be a proper integer. If an error
65 occurs in parsing the arguments, TK_SCROLL_ERROR is returned and an
66 error message is left in interp->result.
67
68 Tk_GetScrollInfoObj is identical in function to Tk_GetScrollInfo. How‐
69 ever, Tk_GetScrollInfoObj accepts Tcl_Obj style arguments, making it
70 more appropriate for use with new development.
71
72
74 parse, scrollbar, scrolling command, xview, yview
75
76
77
78Tk 8.0 Tk_GetScrollInfo(3)