📄 getclrmap.3
字号:
'\"'\" 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.'\" '\" SCCS: @(#) GetClrmap.3 1.5 96/03/26 18:09:27'\" .so man.macros.TH Tk_GetColormap 3 4.0 Tk "Tk Library Procedures".BS.SH NAMETk_GetColormap, Tk_FreeColormap \- allocate and free colormaps.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spColormap\fBTk_GetColormap(\fIinterp, tkwin, string\fB)\fR.sp\fBTk_FreeColormap(\fIdisplay, colormap\fB)\fR.SH ARGUMENTS.AS "Colormap" colormap.AP Tcl_Interp *interp inInterpreter to use for error reporting..AP Tk_Window tkwin inToken for window in which colormap will be used..AP char *string inSelects a colormap: either \fBnew\fR or the name of a windowwith the same screen and visual as \fItkwin\fR..AP Display *display inDisplay for which \fIcolormap\fR was allocated..AP Colormap colormap inColormap to free; must have been returned by a previouscall to \fBTk_GetColormap\fR or \fBTk_GetVisual\fR..BE.SH DESCRIPTION.PPThese procedures are used to manage colormaps.\fBTk_GetColormap\fR returns a colormap suitable for use in \fItkwin\fR.If its \fIstring\fR argument is \fBnew\fR then a new colormap iscreated; otherwise \fIstring\fR must be the name of another windowwith the same screen and visual as \fItkwin\fR, and the colormap from thatwindow is returned.If \fIstring\fR doesn't make sense, or if it refers to a window ona different screen from \fItkwin\fR or witha different visual than \fItkwin\fR, then \fBTk_GetColormap\fR returns\fBNone\fR and leaves an error message in \fIinterp->result\fR..PP\fBTk_FreeColormap\fR should be called when a colormap returned by\fBTk_GetColormap\fR is no longer needed.Tk maintains a reference count for each colormap returned by\fBTk_GetColormap\fR, so there should eventually be one call to\fBTk_FreeColormap\fR for each call to \fBTk_GetColormap\fR.When a colormap's reference count becomes zero, Tk releases theX colormap..PP\fBTk_GetVisual\fR and \fBTk_GetColormap\fR work together, in thata new colormap created by \fBTk_GetVisual\fR may later be returnedby \fBTk_GetColormap\fR.The reference counting mechanism for colormaps includes both procedures,so callers of \fBTk_GetVisual\fR must also call \fBTk_FreeColormap\fRto release the colormap.If \fBTk_GetColormap\fR is called with a \fIstring\fR value of\fBnew\fR then the resulting colormap will neverbe returned by \fBTk_GetVisual\fR; however, it can be used in otherwindows by calling \fBTk_GetColormap\fR with the original window'sname as \fIstring\fR..SH KEYWORDScolormap
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -