Tk\_SetWindowVisual(3) Tk Library Procedures Tk\_SetWindowVisual(3)

```

```

# [NAME](#NAME)

Tk\_SetWindowVisual - change visual characteristics of window

# [SYNOPSIS](#SYNOPSIS)

```
#include <tk.h>

int
Tk_SetWindowVisual(tkwin, visual, depth, colormap)
```

# [ARGUMENTS](#ARGUMENTS)

Tk\_Window *tkwin* (in)

Token for window.

Visual *\*visual* (in)

New visual type to use for *tkwin*.

int *depth* (in)

Number of bits per pixel desired for *tkwin*.

Colormap *colormap* (in)

New colormap for *tkwin*, which must be compatible with *visual* and *depth*.

```
    
```

# [DESCRIPTION](#DESCRIPTION)

When Tk creates a new window it assigns it the default visual characteristics (visual, depth, and colormap) for its screen. **Tk\_SetWindowVisual** may be called to change them. **Tk\_SetWindowVisual** must be called before the window has actually been created in X (e.g. before **Tk\_MapWindow** or **Tk\_MakeWindowExist** has been invoked for the window). The safest thing is to call **Tk\_SetWindowVisual** immediately after calling **Tk\_CreateWindow**. 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.

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.

# [KEYWORDS](#KEYWORDS)

colormap, depth, visual

4.0 Tk

---

Document: Tk_SetWindowVisual(3) from tk 9.0.4-r2 (Chainguard OS)
Source: https://downloads.sourceforge.net/sourceforge/tcl/tk9.0.4-src.tar.gz
