Tk_GetScrollInfo(3)
π Tk_GetScrollInfo(3) β Tk Library Procedures π
okay so bestie, welcome to the Tk Library Procedures page for Tk_GetScrollInfoObj and Tk_GetScrollInfo β genuinely iconic little helpers, no cap.
β¨ NAME β¨
Tk_GetScrollInfoObj, Tk_GetScrollInfo β literally the functions that parse arguments for scrolling commands. that's it, that's the gig π«Ά
πΈ SYNOPSIS πΈ
#include <tk.h>
int
Tk_GetScrollInfoObj(interp, objc, objv, fractionPtr, stepsPtr)
int
Tk_GetScrollInfo(interp, argc, argv, fractionPtr, stepsPtr)
π¦ ARGUMENTS π¦
Tcl_Interp *interp(in) β the interpreter we use for error reporting. if something goes wrong, the tea gets spilled here πTcl_Size objc(in) β how manyTcl_Obj's live in theobjvarray.Tcl_Obj *const *objv(in) β the argument objects. these represent the entire widget command, where the first word is typically the widget name and the second word is typicallyxvieworyview. main character energy fr fr πint argc(in) β how many strings are in theargvarray.const char **argv(in) β the argument strings. again, these represent the entire widget command: first word is typically the widget name, second word is typicallyxvieworyview.double *fractionPtr(out) β gets filled in with the fraction from themovetooption, if there is one πint *stepsPtr(out) β gets filled in with the line or page count from thescrolloption, if there is one. heads up: the value may be negative π
π DESCRIPTION π
Tk_GetScrollInfoObj parses the arguments that widget scrolling commands like xview and yview expect. it receives the entire list of words that make up a widget command, and it parses the words starting with objv[2]. those words starting with objv[2] must have one of these forms:
moveto fraction
scroll number pages
scroll number units
any of the moveto, scroll, pages, and units keywords may be abbreviated (yes bestie, abbreviations are valid, slay) β¨
if objv has the moveto form, then TK_SCROLL_MOVETO is returned as the result, and *fractionPtr gets filled in with the fraction argument to the command β and that fraction must be a proper real value.
if objv has the scroll form, then TK_SCROLL_PAGES or TK_SCROLL_UNITS is returned, and *stepsPtr gets filled in with the number value. that number must be an integer or a float β but if it is a float, it gets converted to an integer, rounded away from 0 π
if an error happens while parsing the arguments, TK_SCROLL_ERROR is returned and an error message is left in interpreter interp's result. so like, if it flops, it flops loudly π
Tk_GetScrollInfo is identical in function to Tk_GetScrollInfoObj. the one glow-up: Tk_GetScrollInfo accepts string arguments, which makes it more appropriate for use with legacy widgets π§
ngl, the "identical in function" thing is real β same behaviour, just a string-flavoured interface for the legacy girlies.
π₯ KEYWORDS π₯
parse, scrollbar, scrolling command, xview, yview
that's the whole page, bestie β go parse some scroll commands, you're gonna ate π
β§ο½₯οΎ Tk 8.0 Β· Tk_GetScrollInfo(3) Β· sending you love and correct return values ο½₯οΎβ§ π
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1994 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms