Tk_GetVisual(3)
β¨ Tk_GetVisual(3) β¨
okay bestie, welcome to the Tk Library Procedures page for Tk_GetVisual β the string-to-visual translator. it's giving βfind me a suitable X Visual for this window,β and I'm obsessed. π
πΈ NAME πΈ
Tk_GetVisual β translate from string to visual. literally the glow-up from text to visual. β¨
π SYNOPSIS π
#include <tk.h>
Visual *
Tk_GetVisual(interp, tkwin, string, depthPtr, colormapPtr)
π¦ ARGUMENTS π¦
Tcl_Interp *interp (in)β interpreter to use for error reporting. she's the messenger for any oops.Tk_Window tkwin (in)β token for window in which the visual will be used. main character window energy.const char *string (in)β string that identifies the desired visual. valid formats are down in DESCRIPTION, iykyk.int *depthPtr (out)β depth of the returned visual gets stored here.Colormap *colormapPtr (out)β if non-NULL, then a suitable colormap for the visual is found and its identifier is stored here. π
π DESCRIPTION π
Tk_GetVisual takes a string description of a visual and finds a suitable X Visual for use in tkwin, if there is one. it returns a pointer to the X Visual structure for the visual and stores the number of bits per pixel for it at *depthPtr. if string is unrecognizable or if no suitable visual could be found, then NULL is returned and Tk_GetVisual leaves an error message in interpreter interp's result. π no visual? it said error message.
If colormap is non-NULL then Tk_GetVisual also locates an appropriate colormap for use with the result visual and stores its X identifier at *colormapPtr.
The string argument specifies the desired visual in one of the following ways:
class depthβ the string consists of a class name followed by an integer depth, with any amount of white space (including none) in between.classselects what sort of visual is desired and must be one ofdirectcolor,grayscale,greyscale,pseudocolor,staticcolor,staticgray,staticgrey, ortruecolor, or a unique abbreviation.depthspecifies how many bits per pixel are needed for the visual. if possible,Tk_GetVisualwill return a visual with this depth; if there is no visual of the desired depth thenTk_GetVisuallooks first for a visual with greater depth, then one with less depth. β¨defaultβ use the default visual fortkwin's screen. the safe vibe.pathNameβ use the visual for the window given bypathName.pathNamemust be the name of a window on the same screen astkwin. no cross-screen drama, bestie.numberβ use the visual whose X identifier isnumber. numbers era.best ?depth?β choose the βbest possibleβ visual, using the following rules, in decreasing order of priority:- (a) a visual that has exactly the desired depth is best, followed by a visual with greater depth than requested (but as little extra as possible), followed by a visual with less depth than requested (but as great a depth as possible);
- (b) if no depth is specified, then the deepest available visual is chosen;
- (c)
pseudocoloris better thantruecolorordirectcolor, which are better thanstaticcolor, which is better thanstaticgrayorgrayscale; - (d) the default visual for the screen is better than any other visual. π
π CREDITS π
the idea for Tk_GetVisual, and the first implementation, came from Paul Mackerras. shoutout legend π«Ά
β KEYWORDS β
colormap, screen, visual β the keyword trio. π₯
okay that's the whole page! π footer energy: Tk, version 4.0, Tk_GetVisual(3) β byeee, go find your visual bestie β¨π«Ά
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk-devel 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk-devel 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 1994 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms