Tk_GetDash(3)
π Tk_GetDash β the Tk Library Procedures glow-up π
okay bestie, gather round, because we're talking about Tk_GetDash(3) from the Tk Library Procedures and it's genuinely such a vibe once you get it. it takes a string and turns it into a real, valid dash structure. that's it. that's the whole girl. β¨
β¨ NAME β¨
Tk_GetDash β convert from string to valid dash structure. iconic, no notes π
πΈ SYNOPSIS πΈ
#include <tk.h>
int
Tk_GetDash(interp, string, dashPtr)
π ARGUMENTS π
Tcl_Interp *interp(in) β the interpreter she reports her errors to, aka the group chat where the drama gets posted. π¬const char *string(in) β the textual value that's getting converted. the raw material, the clay, the before pic. π¦Tk_Dash *dashPtr(out) β points to the place where the converted dash pattern value gets stored. must not beNULL, bestie, don't do that. π
π DESCRIPTION π
so this procedure parses the string and fills in the result inside the Tk_Dash structure. the string can be either a list of integers, or a character string containing only .,-_ and spaces. if all goes well, TCL_OK is returned and a dash descriptor is stored in the variable pointed to by dashPtr. and if string doesn't have the proper syntax? TCL_ERROR comes back, an error message gets left in the interpreter's result, and literally nothing is stored at *dashPtr. nothing. not a crumb. π
π syntax number one: the list of integers
The first possible syntax is a list of integers. Each element represents the number of pixels of a line segment. Only the odd segments are drawn using the outline color. The other segments are drawn transparent. so like, alternating pixels of yes and no. main character pixels and background pixels. β
π¦ syntax number two: the character list
The second possible syntax is a character list containing only 5 possible characters .,-_ plus space. The space can be used to enlarge the space between other line elements, and can not occur in the first position of the string β so no leading space, she does not start with space, periodt. some examples:
-dash . = -dash {2 4}
-dash - = -dash {6 4}
-dash -. = -dash {6 4 2 4}
-dash -.. = -dash {6 4 2 4 2 4}
-dash {. } = -dash {2 8}
-dash , = -dash {4 4}
The main difference between this syntax and the numeric one is that it's shape-conserving. which means all values in the dash list get multiplied by the line width before display. so "." is always gonna show up as an actual dot and "-" is always gonna show up as an actual dash, no matter what the line width is doing. consistency queen. π
β οΈ heads up: on systems where there's only a limited set of dash patterns available, the dash pattern will be displayed as the closest dash pattern that IS available. for example, on Windows only the first 4 of the examples above are available; the last 2 examples will be displayed identically to the first one. so on Windows,{. }and,are lowkey just cosplaying as.. π
π₯ SEE ALSO π₯
π« KEYWORDS π«
dash, conversion
and that's the whole page, bestie! π«Ά this one's from Tk 8.3, dated right there in the footer with the Tk_GetDash(3) title β so if you're out here dashing on anything older, check yourself before you wreck yourself. go forth and dash responsibly. πβ¨π
π¦ where this page comes from
- alpine 3.22: tk-doc 8.6.16-r0 Β· TCL
- alpine 3.23: tk-doc 8.6.17-r0 Β· TCL
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk-doc 8.6.17-r1 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- arch rolling: tk 8.6.16-1 Β· TCL
- centos-stream 10: tk-devel 1:8.6.13-5.el10 Β· 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 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: tk8-devel 1:8.6.16-2.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk8-devel 1:8.6.16-2.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
- fedora 44: tk8-devel 1:8.6.17-2.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk8-devel 1:8.6.17-2.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
- opensuse-leap 16.0: tk-devel 8.6.13-160000.2.2 Β· TCL
- opensuse-leap 16.0: tk-devel 8.6.13-160000.2.2 Β· TCL
- opensuse-leap 16.0: tk-devel 8.6.13-160000.2.2 Β· TCL
- opensuse-leap 16.0: tk-devel 8.6.13-160000.2.2 Β· TCL
- Copyright (c) 1989-1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms