📄 getgc.3
字号:
'\"'\" Copyright (c) 1990 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: @(#) GetGC.3 1.11 96/03/26 18:10:14'\" .so man.macros.TH Tk_GetGC 3 "" Tk "Tk Library Procedures".BS.SH NAMETk_GetGC, Tk_FreeGC \- maintain database of read-only graphics contexts.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spGC\fBTk_GetGC\fR(\fItkwin, valueMask, valuePtr\fR).sp\fBTk_FreeGC(\fIdisplay, gc\fR).SH ARGUMENTS.AS "unsigned long" valueMask.AP Tk_Window tkwin inToken for window in which the graphics context will be used..AP "unsigned long" valueMask inMask of bits (such as \fBGCForeground\fR or \fBGCStipple\fR)indicating which fields of \fI*valuePtr\fR are valid..AP XGCValues *valuePtr inPointer to structure describing the desired values for thegraphics context..AP Display *display inDisplay for which \fIgc\fR was allocated..AP GC gc inX identifier for graphics context that is no longer needed.Must have been allocated by \fBTk_GetGC\fR..BE.SH DESCRIPTION.PP\fBTk_GetGC\fR and \fBTk_FreeGC\fR manage a collection of graphics contextsbeing used by an application. The procedures allow graphics contexts to beshared, thereby avoiding the server overhead that would be incurredif a separate GC were created for each use. \fBTk_GetGC\fR takes argumentsdescribing the desired graphics context and returns an X identifierfor a GC that fits the description. The graphics context that is returnedwill have default values in all of the fields not specified explicitlyby \fIvalueMask\fR and \fIvaluePtr\fR..PP\fBTk_GetGC\fR maintains adatabase of all the graphics contexts it has created. Whenever possible,a call to \fBTk_GetGC\fR willreturn an existing graphics context rather than creating a new one. Thisapproach can substantially reduce server overhead, so \fBTk_GetGC\fRshould generally be used in preference to the Xlib procedure\fBXCreateGC\fR, which creates a new graphics context on each call..PPSince the return values of \fBTk_GetGC\fRare shared, callers should never modify the graphics contextsreturned by \fBTk_GetGC\fR.If a graphics context must be modified dynamically, then it should becreated by calling \fBXCreateGC\fR instead of \fBTk_GetGC\fR..PPWhen a graphics contextis no longer needed, \fBTk_FreeGC\fR should be called to release it.There should be exactly one call to \fBTk_FreeGC\fR foreach call to \fBTk_GetGC\fR.When a graphics context is no longer in use anywhere (i.e. it hasbeen freed as many times as it has been gotten) \fBTk_FreeGC\fRwill release it to the X server and delete it from the database..SH KEYWORDSgraphics context
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -