📄 getvisual.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: @(#) GetVisual.3 1.9 96/03/26 18:13:20'\" .so man.macros.TH Tk_GetVisual 3 4.0 Tk "Tk Library Procedures".BS.SH NAMETk_GetVisual \- translate from string to visual.SH SYNOPSIS.nf\fB#include <tk.h>\fR.spVisual *\fBTk_GetVisual(\fIinterp, tkwin, string, depthPtr, colormapPtr\fB)\fR.SH ARGUMENTS.AS "Tcl_Interp" *colormapPtr.AP Tcl_Interp *interp inInterpreter to use for error reporting..AP Tk_Window tkwin inToken for window in which the visual will be used..AP char *string inString that identifies the desired visual. See below forvalid formats..AP int *depthPtr outDepth of returned visual gets stored here..AP Colormap *colormapPtr outIf non-NULL then a suitable colormap for visual is found and itsidentifier is stored here..BE.SH DESCRIPTION.PP\fBTk_GetVisual\fR takes a string description of a visual andfinds a suitable X Visual for use in \fItkwin\fR, if there is one.It returns a pointer to the X Visual structure for the visualand stores the number of bits per pixel for it at \fI*depthPtr\fR.If \fIstring\fR is unrecognizable or if no suitable visual couldbe found, then NULL is returned and \fBTk_GetVisual\fR leavesan error message in \fIinterp->result\fR.If \fIcolormap\fR is non-NULL then \fBTk_GetVisual\fRalso locates an appropriate colormap for use with the result visualand stores its X identifier at \fI*colormapPtr\fR..PPThe \fIstring\fR argument specifies the desired visual in oneof the following ways:.TP 15\fIclass depth\fRThe string consists of a class name followed by an integer depth,with any amount of white space (including none) in between.\fIclass\fR selects what sort of visual is desired and must be one of\fBdirectcolor\fR, \fBgrayscale\fR, \fBgreyscale\fR, \fBpseudocolor\fR,\fBstaticcolor\fR, \fBstaticgray\fR, \fBstaticgrey\fR, or\fBtruecolor\fR, or a unique abbreviation.\fIdepth\fR specifies how many bits per pixel are needed for thevisual.If possible, \fBTk_GetVisual\fR will return a visual with this depth;if there is no visual of the desired depth then \fBTk_GetVisual\fRlooks first for a visual with greater depth, then one with lessdepth..TP 15\fBdefault\fRUse the default visual for \fItkwin\fR's screen..TP 15\fIpathName\fRUse the visual for the window given by \fIpathName\fR.\fIpathName\fR must be the name of a window on the same screenas \fItkwin\fR..TP 15\fInumber\fRUse the visual whose X identifier is \fInumber\fR..TP 15\fBbest\fR ?\fIdepth\fR?Choose the ``best possible'' visual, using the following rules, indecreasing order of priority:(a) a visual that has exactly the desired depth is best, followedby a visual with greater depth than requested (but as little extraas possible), followed by a visual with less depth than requested(but as great a depth as possible);(b) if no \fIdepth\fR is specified, then the deepest available visualis chosen;(c) \fBpseudocolor\fR is better than \fBtruecolor\fR or \fBdirectcolor\fR,which are better than \fBstaticcolor\fR, which is better than\fBstaticgray\fR or \fBgrayscale\fR;(d) the default visual for the screen is better than any other visual..SH CREDITS.PPThe idea for \fBTk_GetVisual\fR, and the first implementation, camefrom Paul Mackerras..SH KEYWORDScolormap, screen, visual
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -