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