Tk_GetCapStyle(3)
π Tk_GetCapStyle β bestie's guide to cap styles β¨
okay so this page is from the Tk Library Procedures manual, and it's literally all about translating between strings and cap styles. tiny page, big slay π
β¨ NAME β¨
Tk_GetCapStyle, Tk_NameOfCapStyle β the little duo that translates between strings and cap styles π¦
πΈ SYNOPSIS πΈ
#include <tk.h>
int
Tk_GetCapStyle(interp, string, capPtr)
const char *
Tk_NameOfCapStyle(cap)
π ARGUMENTS π
Tcl_Interp *interp(in) β the interpreter we use for error reporting, bestie. π«Άconst char *string(in) β a string holding the name of a cap style: one of βbuttβ, βprojectingβ, or βroundβ β or a unique abbreviation of one of those. no cap. πint *capPtr(out) β pointer to the spot where we stash the X cap style that corresponds tostringβ¨int cap(in) β the cap style itself: one ofCapButt,CapProjecting, orCapRoundπ
π¦ DESCRIPTION π¦
Tk_GetCapStyle places in *capPtr the X cap style corresponding to string. That's gonna be one of the values CapButt, CapProjecting, or CapRound. Cap styles are typically used in X graphics contexts to indicate how the end-points of lines should be capped β and honestly, iconic behaviour. See the X documentation for info on what each style actually implies, iykyk. π
Under normal circumstances the return value is TCL_OK and interp is unused. But if string doesn't contain a valid cap style (or an abbreviation of one of those names), then an error message gets stored in interpreter interp's result, TCL_ERROR is returned, and *capPtr is left unmodified. not me being dramatic about it but that's just how it is π
Tk_NameOfCapStyle is the logical inverse of Tk_GetCapStyle. Give it a cap style like CapButt and it hands you back a statically-allocated string corresponding to cap. And if cap is not a legal cap style? it returns βunknown cap styleβ. the audacity π
π₯ KEYWORDS π₯
butt, cap style, projecting, round
lowkey obsessed with how short this page is. main character energy fr fr π
that's the whole vibe β source and version are just Tk, dated right alongside the Tk_GetCapStyle(3) footer, so mwah, hope this helped bestie π§β¨π
π¦ 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) 1990 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