## Tcl9.0.3/Tk9.0.3 Documentation > Tk C API > SetVisual

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

  NAME
    Tk_SetWindowVisual — change visual characteristics of window
  SYNOPSIS
    #include <tk.h>
    int
    Tk_SetWindowVisual(tkwin, visual, depth, colormap)
  引数 ARGUMENTS
    Tk_Window tkwin (入力in)
    Visual *visual (入力in)
    int depth (入力in)
    Colormap colormap (入力in)
  説明 DESCRIPTION
  KEYWORDS

### NAME

Tk_SetWindowVisual — change visual characteristics of window

### SYNOPSIS

#include <tk.h>
int
Tk_SetWindowVisual(tkwin, visual, depth, colormap)

### 引数 ARGUMENTS

Tk_Window tkwin (入力in)
  窓の字句結果｡ Token for window.

Visual *visual (入力in)
  tkwin についての新しい外観の型｡ New visual type to use for tkwin.

int depth (入力in)
  望ましいtkwin についての画素単位のビット数｡ Number of bits per pixel desired for tkwin.

Colormap colormap (入力in)
  tkwin についての新しい画素地図､それは visual と depth.と両立しなければならない｡ New colormap for tkwin, which must be compatible with visual and depth.

### 説明 DESCRIPTION

Tk が新しい窓を作成した時その画面について省略時設定の外観性質(外観､深さ､画素地図)を割り当てた｡Tk_SetWindowVisual はそれを変更する為に呼ばれるかもしれない｡Tk_SetWindowVisual は X 内に窓が実際に作成される前に呼ばれなければならない(譬えば､窓の為にTk_MapWindow か Tk_MakeWindowExist が起動される前に)｡最も安全なことは Tk_CreateWindow.を呼んだ直後に Tk_SetWindowVisual を呼ぶことである｡もしTk_SetWindowVisual が呼ばれる前に既に tkwin が生成していた場合は 0 を返し､なにも変更しない; それ以外の場合は操作が成功裏に完成したことを表す 1 を返す｡ 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.

もし､ 外観や深さの変更なしに窓の色地図を変更を望む場合は､ Tk_SetWindowVisualは呼ばれない方が好い｡ 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

colormap, depth, visual
Copyright © 1992 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.