GetClrmap.3
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:3k
- '"
- '" Copyright (c) 1994 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '"
- '" See the file "license.terms" for information on usage and redistribution
- '" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- '"
- '" RCS: @(#) $Id: GetClrmap.3,v 1.3 2002/08/05 04:30:38 dgp Exp $
- '"
- .so man.macros
- .TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures"
- .BS
- .SH NAME
- Tk_GetColormap, Tk_FreeColormap - allocate and free colormaps
- .SH SYNOPSIS
- .nf
- fB#include <tk.h>fR
- .sp
- Colormap
- fBTk_GetColormap(fIinterp, tkwin, stringfB)fR
- .sp
- fBTk_FreeColormap(fIdisplay, colormapfB)fR
- .SH ARGUMENTS
- .AS "Colormap" colormap
- .AP Tcl_Interp *interp in
- Interpreter to use for error reporting.
- .AP Tk_Window tkwin in
- Token for window in which colormap will be used.
- .AP "CONST char" *string in
- Selects a colormap: either fBnewfR or the name of a window
- with the same screen and visual as fItkwinfR.
- .AP Display *display in
- Display for which fIcolormapfR was allocated.
- .AP Colormap colormap in
- Colormap to free; must have been returned by a previous
- call to fBTk_GetColormapfR or fBTk_GetVisualfR.
- .BE
- .SH DESCRIPTION
- .PP
- These procedures are used to manage colormaps.
- fBTk_GetColormapfR returns a colormap suitable for use in fItkwinfR.
- If its fIstringfR argument is fBnewfR then a new colormap is
- created; otherwise fIstringfR must be the name of another window
- with the same screen and visual as fItkwinfR, and the colormap from that
- window is returned.
- If fIstringfR doesn't make sense, or if it refers to a window on
- a different screen from fItkwinfR or with
- a different visual than fItkwinfR, then fBTk_GetColormapfR returns
- fBNonefR and leaves an error message in fIinterp->resultfR.
- .PP
- fBTk_FreeColormapfR should be called when a colormap returned by
- fBTk_GetColormapfR is no longer needed.
- Tk maintains a reference count for each colormap returned by
- fBTk_GetColormapfR, so there should eventually be one call to
- fBTk_FreeColormapfR for each call to fBTk_GetColormapfR.
- When a colormap's reference count becomes zero, Tk releases the
- X colormap.
- .PP
- fBTk_GetVisualfR and fBTk_GetColormapfR work together, in that
- a new colormap created by fBTk_GetVisualfR may later be returned
- by fBTk_GetColormapfR.
- The reference counting mechanism for colormaps includes both procedures,
- so callers of fBTk_GetVisualfR must also call fBTk_FreeColormapfR
- to release the colormap.
- If fBTk_GetColormapfR is called with a fIstringfR value of
- fBnewfR then the resulting colormap will never
- be returned by fBTk_GetVisualfR; however, it can be used in other
- windows by calling fBTk_GetColormapfR with the original window's
- name as fIstringfR.
- .SH KEYWORDS
- colormap