## Tcl8.6.17/Tk8.6.17 Documentation > Tk C API > MaintGeom

### 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_MaintainGeometry, Tk_UnmaintainGeometry — 他に相対的な一つの窓の幾何の維持　 maintain geometry of one window relative to another
  SYNOPSIS
    #include <tk.h>
    Tk_MaintainGeometry(window, container, x, y, width, height)
    Tk_UnmaintainGeometry(window, container)
  引数 ARGUMENTS
    Tk_Window window (入力in)
    Tk_Window container (入力in)
    int x (入力in)
    int y (入力in)
    int width (入力in)
    int height (入力in)
  説明 DESCRIPTION
  KEYWORDS

### NAME

Tk_MaintainGeometry, Tk_UnmaintainGeometry — 他に相対的な一つの窓の幾何の維持　 maintain geometry of one window relative to another

### SYNOPSIS

#include <tk.h>
Tk_MaintainGeometry(window, container, x, y, width, height)
Tk_UnmaintainGeometry(window, container)

### 引数 ARGUMENTS

Tk_Window window (入力in)
  その幾何が制御される窓 Window whose geometry is to be controlled.

Tk_Window container (入力in)
  その幾何が制御される子供に相対的な窓 Window relative to which window's geometry will be controlled.

int x (入力in)
  親分の中での望ましい子供のx-座標､親分の左の縁の内部から子供の左縁の外側迄､画素単位で測定される｡ Desired x-coordinate of window in container, measured in pixels from the inside of container's left border to the outside of window's left border.

int y (入力in)
  親分の中での望ましい子供のy-座標､親分の上の縁の内部から子供の上縁の外側迄､画素単位で測定される｡ Desired y-coordinate of window in container, measured in pixels from the inside of container's top border to the outside of window's top border.

int width (入力in)
  子供の為の望ましい巾､画素単位｡　 Desired width for window, in pixels.

int height (入力in)
  子供の為の望ましい高さ､画素単位｡　 Desired height for window, in pixels.

### 説明 DESCRIPTION

Tk_MaintainGeometry と Tk_UnmaintainGeometry は幾何管理譜に子供の親分が親でない子供の扱いを容易にする｡子供の親分が親でないばあいは三つの問題が生じる: Tk_MaintainGeometry and Tk_UnmaintainGeometry make it easier for geometry managers to deal with windows whose containers are not their parents. Three problems arise if the container for a window is not its parent:

1. 子供の x- と y-位置は親分の座標系から､子供を配置する前の親の座標系に変換されなければならない｡ The x- and y-position of the window must be translated from the coordinate system of the container to that of the parent before positioning the window.

2. もし親分の窓かその子供の親までの祖先が移動されると､子供は､親分に相対的に正しい位置を維持するために親の中で再配置されなければならない｡ If the container window, or any of its ancestors up to the window's parent, is moved, then the window must be repositioned within its parent in order to maintain the correct position relative to the container.

3. もし親分かその祖先の一つが対応付け又は対応付け解除されると､子供はそれに呼応して対応付け又は解除されなければならない｡ If the container or one of its ancestors is mapped or unmapped, then the window must be mapped or unmapped to correspond.

もし親と親分が同じ場合は､これらのどの問題も発生しない｡譬えば､もし親分かその祖先が対応解除になった時､子供は自動的に X によって画面から除去される｡ None of these problems is an issue if the parent and container are the same. For example, if the container or one of its ancestors is unmapped, the window is automatically removed by the screen by X.

Tk_MaintainGeometry はその親分が親でない子供の問題を､簡単な場合の親分が親である子供と同じに扱う｡Tk_MaintainGeometry は典型的には､一度は子供がその親分に相対的に位置決めした窓管理譜によって呼出される｡ Tk_MaintainGeometry は座標を子供の親の座標系に変換し､次に子供を移動し適切に寸法変更する｡更に､望ましい位置を記憶し､親分と親までのその全ての祖先(親は含まない)を監視する為の行事処理機能を作成する｡もし､これのどれかの窓が､移動､対応付け､対応付け外しされると､子供は､親分が対応付けられた時のみ､ x, y, width, and height.によって指定された様にその相対幾何が親分に対して維持されるように､調整される｡ Tk_MaintainGeometry deals with these problems for windows whose containers are not their parents, as well as handling the simpler case of windows whose container are their parents. Tk_MaintainGeometry is typically called by a window manager once it has decided where a window should be positioned relative to its container. Tk_MaintainGeometry translates the coordinates to the coordinate system of window's parent and then moves and resizes the window appropriately. Furthermore, it remembers the desired position and creates event handlers to monitor the container and all of its ancestors up to (but not including) the window's parent. If any of these windows is moved, mapped, or unmapped, the window will be adjusted so that it is mapped only when the container is mapped and its geometry relative to the container remains as specified by x, y, width, and height.

窓管理譜が窓の制御を放棄するとき､又はどの様な条件下でも窓が画面上に現れない様望むと決定された場合､Tk_UnmaintainGeometry.を呼ぶ｡Tk_UnmaintainGeometry は窓を対応付け解除し､ master-slave 対の為の Tk_MaintainGeometry の以前の呼び出しは解消されるので､子供の幾何と対応付け状態は最早自動的には維持されない｡もし､子供､親分､親分のどれかの祖先が破壊された場合､Tk_UnmaintainGeometry は幾何管理譜によって呼出される必要はない: Tk はそれを自動的に呼ぶ｡ When a window manager relinquishes control over a window, or if it decides that it does not want the window to appear on the screen under any conditions, it calls Tk_UnmaintainGeometry. Tk_UnmaintainGeometry unmaps the window and cancels any previous calls to Tk_MaintainGeometry for the container-window pair, so that the window's geometry and mapped state are no longer maintained automatically. Tk_UnmaintainGeometry need not be called by a geometry manager if the window, the container, or any of the container's ancestors is destroyed: Tk will call it automatically.

Tk_MaintainGeometry が繰返し同じ master-slave 対の為に呼出された場合､最も最近の呼び出しからの情報がどの古い情報にも取って代わる｡もし､ Tk_UnmaintainGeometry が現在管理されていない master-slave 対の為に呼びだされた場合､その呼出しは効果は有さない｡ If Tk_MaintainGeometry is called repeatedly for the same container-window pair, the information from the most recent call supersedes any older information. If Tk_UnmaintainGeometry is called for a container-window pair that is is not currently managed, the call has no effect.

### KEYWORDS

geometry manager, map, container, parent, position, window, unmap
Copyright © 1994 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.