Tk_InternAtom(3)
π
Tk_InternAtom(3) β Tk Library Procedures π
okay so this is the Tk Library Procedures page for Tk_InternAtom and Tk_GetAtomName, and it's literally all about managing the cache of X atoms. bestie, it's giving "small API, big cache energy" β¨
πΈ NAME πΈ
Tk_InternAtom, Tk_GetAtomName β manage cache of X atoms π
β¨ SYNOPSIS β¨
#include <tk.h>
Atom
Tk_InternAtom(tkwin, name)
const char *
Tk_GetAtomName(tkwin, atom)
π ARGUMENTS π
Tk_Window tkwin(in)β token for window. Used to map atom or name relative to a particular display.const char *name(in)β string name for which atom is desired.Atom atom(in)β atom for which corresponding string name is desired.
π¦ DESCRIPTION π¦
These procedures are similar to the Xlib procedures XInternAtom and XGetAtomName. Tk_InternAtom returns the atom identifier associated with string given by name; the atom identifier is only valid for the display associated with tkwin. Tk_GetAtomName returns the string associated with atom on tkwin's display. The string returned by Tk_GetAtomName is in Tk's storage: the caller need not free this space when finished with the string, and the caller should not modify the contents of the returned string. If there is no atom atom on tkwin's display, then Tk_GetAtomName returns the string ?bad atom?.
okay important bestie: the returned string lives in Tk's storage π the caller does not need to free that space when done, and the caller should not modify the contents of the returned string. also if the atom isn't there, you get ?bad atom? β iconic little error string, ngl π
Tk caches the information returned by Tk_InternAtom and Tk_GetAtomName so that future calls for the same information can be serviced from the cache without contacting the server. Thus Tk_InternAtom and Tk_GetAtomName are generally much faster than their Xlib counterparts, and they should be used in place of the Xlib procedures. π₯
π KEYWORDS π
atomcachedisplay
signed off by source/version Tk Β· page Tk_InternAtom(3) Β· date: not listed in the footer π«Άπ
π¦ 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