---
name: "InternAtom"
section: "2"
platform: "linux"
package: "perl-tk"
version: "b11.02-5"
release: "Debian 1.3 (Bo)"
platforms: ["linux"]
url: "https://new.carta.tech/InternAtom"
---

# InternAtom(2)

manage cache of X atoms

## NAME

Tk\_InternAtom, Tk\_GetAtomName - manage cache of X atoms

## SYNOPSIS

```
#include <tk.h>

Atom
Tk_InternAtom(tkwin, name)

char *
Tk_GetAtomName(tkwin, atom)
```

## ARGUMENTS

Token for window.  Used to map atom or name relative to a particular display. String name for which atom is desired. 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?''.

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

atom, cache, display
