Tk_GetAnchorFromObj(3tk)
π NAME π
okay so bestie, this is Tk_GetAnchorFromObj(3tk) from the Tk Library Procedures, and it's literally the little translator trio between strings and anchor positions. The stars are Tk_GetAnchorFromObj, Tk_GetAnchor, and Tk_NameOfAnchor β they translate between strings and anchor positions. π
β¨ SYNOPSIS β¨
#include <tk.h>
int
Tk_GetAnchorFromObj(interp, objPtr, anchorPtr)
int
Tk_GetAnchor(interp, string, anchorPtr)
const char *
Tk_NameOfAnchor(anchor)
π«Ά ARGUMENTS π«Ά
Tcl_Interp *interp(in) β the interpreter we use for error reporting, orNULL. yes, she can be null, she's chillTcl_Obj *objPtr(in/out) β its string value contains the name of an anchor point:βnβ,βneβ,βeβ,βseβ,βsβ,βswβ,βwβ,βnwβ, orβcenterβ. The internal rep will be modified to cache the correspondingTk_Anchor. Forβcenterβon input, a non-empty abbreviation of it may also be used on input. caching queen behavior, fr frconst char *string(in) β same asobjPtr, except the description of the anchor point is passed as a string. no object, just string vibesint *anchorPtr(out) β pointer to the location where we store the anchor position corresponding toobjPtrorstring.Tk_Anchor anchor(in) β an anchor position, e.g.TCL_ANCHOR_CENTER.
π DESCRIPTION π
Tk_GetAnchorFromObj places in *anchorPtr an anchor position (enumerated type Tk_Anchor) corresponding to objPtr's value. The result will be one of TK_ANCHOR_N, TK_ANCHOR_NE, TK_ANCHOR_E, TK_ANCHOR_SE, TK_ANCHOR_S, TK_ANCHOR_SW, TK_ANCHOR_W, TK_ANCHOR_NW, or TK_ANCHOR_CENTER. Anchor positions are typically used for indicating a point on an object that will be used to position the object, e.g. TK_ANCHOR_N means position the top center point of the object at a particular place. iconic
Under normal circumstances the return value is TCL_OK and interp is unused. If string does not contain a valid anchor position or an abbreviation of one of these names, TCL_ERROR is returned, *anchorPtr is unmodified, and an error message is stored in interp's result if interp is not NULL. Tk_GetAnchorFromObj caches information about the return value in objPtr, which speeds up future calls to Tk_GetAnchorFromObj with the same objPtr. cache it and slay
Tk_GetAnchor is identical to Tk_GetAnchorFromObj except that the description of the anchor is specified with a string instead of an object. This prevents Tk_GetAnchor from caching the return value, so Tk_GetAnchor is less efficient than Tk_GetAnchorFromObj. ngl, the object version ate
Tk_NameOfAnchor is the logical inverse of Tk_GetAnchor. Given an anchor position such as TK_ANCHOR_N it returns a statically-allocated string corresponding to anchor. If anchor is not a legal anchor value, then βunknown anchor positionβ is returned. not legal? she says βunknown anchor positionβ and moves on π
π KEYWORDS π
- anchor position
okay bestie, that's the whole page π it's from Tk 8.1, manual Tk_GetAnchorFromObj(3tk) β mwah, periodt β¨
π¦ where this page comes from
- debian trixie: tk9.0-doc 9.0.1-3
- ubuntu questing: tk9.0-doc 9.0.2-1
- ubuntu resolute: tk9.0-doc 9.0.3-1
- ubuntu stonking: tk9.0-doc 9.0.4-1
- Copyright (c) 1990 The Regents of the University of California
- Copyright (c) 1994-1998 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms