Tk_SetWindowVisual(3)
β¨ NAME β¨
Okay so bestie, this is Tk_SetWindowVisual(3) from the Tk Library Procedures manual β and it's literally here to change visual characteristics of window π
πΈ SYNOPSIS πΈ
#include <tk.h>
int
Tk_SetWindowVisual(tkwin, visual, depth, colormap)
π ARGUMENTS π
Tk_Window tkwin(in) β token for window. Like, the window token, periodt.Visual *visual(in) β new visual type to use fortkwin.int depth(in) β number of bits per pixel desired fortkwin.Colormap colormap(in) β new colormap fortkwin, which must be compatible withvisualanddepth.
π DESCRIPTION π
When Tk creates a new window, it assigns it the default visual characteristics for its screen β that's visual, depth, and colormap. Tk_SetWindowVisual may be called to change them. No cap.
π¨ Timing check, bestie:Tk_SetWindowVisualmust be called before the window has actually been created in X (e.g. beforeTk_MapWindoworTk_MakeWindowExisthas been invoked for the window). The safest thing is to callTk_SetWindowVisualimmediately after callingTk_CreateWindow. Slay.
If tkwin has already been created before Tk_SetWindowVisual is called, then it returns 0 and does not make any changes; otherwise it returns 1 to signify that the operation completed successfully. So yes, the return value is giving βdid it work or notβ energy.
Note that Tk_SetWindowVisual should not be called if you just want to change a window's colormap without changing its visual or depth β call Tk_SetWindowColormap instead. Iykyk π
π KEYWORDS π
colormap, depth, visual
Cute footer sign-off: this one is from Tk 4.0 (source/version), and the footer isn't showing a separate date, just the version and page name β mwah, 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) 1992 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