archie/tk3.6/doc/InternAtom.3

72 lines
2.7 KiB
Groff
Raw Normal View History

2024-05-27 16:13:40 +02:00
'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" All rights reserved.
'\"
'\" Permission is hereby granted, without written agreement and without
'\" license or royalty fees, to use, copy, modify, and distribute this
'\" documentation for any purpose, provided that the above copyright
'\" notice and the following two paragraphs appear in all copies.
'\"
'\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
'\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
'\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
'\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'\"
'\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
'\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
'\" AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
'\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
'\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
'\"
'\" $Header: /user6/ouster/wish/man/RCS/InternAtom.3,v 1.4 93/04/01 09:41:41 ouster Exp $ SPRITE (Berkeley)
'\"
.so man.macros
.HS Tk_InternAtom tkc
.BS
.SH NAME
Tk_InternAtom, Tk_GetAtomName \- manage cache of X atoms
.SH SYNOPSIS
.nf
\fB#include <tk.h>\fR
.sp
Atom
\fBTk_InternAtom(\fItkwin, name\fR)
.sp
char *
\fBTk_GetAtomName(\fItkwin, atom\fR)
.SH ARGUMENTS
.AS Tk_Window parent
.AP Tk_Window tkwin in
Token for window. Used to map atom or name relative to a particular display.
.AP char *name in
String name for which atom is desired.
.AP Atom atom in
Atom for which corresponding string name is desired.
.BE
.SH DESCRIPTION
.PP
These procedures are similar to the Xlib procedures
\fBXInternAtom\fR and \fBXGetAtomName\fR. \fBTk_InternAtom\fR
returns the atom identifier associated with string given by
\fIname\fR; the atom identifier is only valid for the display
associated with \fItkwin\fR.
\fBTk_GetAtomName\fR returns the string associated
with \fIatom\fR on \fItkwin\fR's display. The string returned
by \fBTk_GetAtomName\fR 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 \fIatom\fR on \fItkwin\fR's display,
then \fBTk_GetAtomName\fR returns the string ``?bad atom?''.
.PP
Tk caches
the information returned by \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
so that future calls
for the same information can be serviced from the cache without
contacting the server. Thus \fBTk_InternAtom\fR and \fBTk_GetAtomName\fR
are generally much faster than their Xlib counterparts, and they
should be used in place of the Xlib procedures.
.SH KEYWORDS
atom, cache, display