Tk_GetAnchorFromObj(3tk)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ 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, or NULL. yes, she can be null, she's chill
  • Tcl_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 corresponding Tk_Anchor. For β€œcenter” on input, a non-empty abbreviation of it may also be used on input. caching queen behavior, fr fr
  • const char *string (in) β€” same as objPtr, except the description of the anchor point is passed as a string. no object, just string vibes
  • int *anchorPtr (out) β€” pointer to the location where we store the anchor position corresponding to objPtr or string.
  • 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