winfo \- Return window-related information
winfo option ?arg arg ...?
The winfo command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the option argument. The legal forms are:
Returns a decimal string giving the integer identifier for the atom whose name is name. If no atom exists with the name name then a new one is created.
Returns the textual name for the atom whose integer identifier is id. This command is the inverse of the winfo :atom command. Generates an error if no such atom exists.
Returns a decimal string giving the number of cells in the color map for window.
Returns a list containing the path names of all the children of window. Top-level windows are returned as children of their logical parents.
Returns the class name for window.
Returns the path name for the window containing the point given by rootX and rootY. RootX and rootY are specified in screen units (i.e. any form acceptable to Tk_GetPixels) in the coordinate system of the root window (if a virtual-root window manager is in use then the coordinate system of the virtual root window is used). If no window in this application contains the point then an empty string is returned. In selecting the containing window, children are given higher priority than parents and among siblings the highest one in the stacking order is chosen.
Returns a decimal string giving the depth of window (number of bits per pixel).
Returns 1 if there exists a window named window, 0 if no such window exists.
Returns a floating-point value giving the number of pixels in window corresponding to the distance given by number. Number may be specified in any of the forms acceptable to Tk_GetScreenMM, such as “2.0c” or “1i”. The return value may be fractional; for an integer value, use winfo :pixels.
Returns the geometry for window, in the form widthxheight+x+y. All dimensions are in pixels.
Returns a decimal string giving window’s height in pixels. When a window is first created its height will be 1 pixel; the height will eventually be changed by a geometry manager to fulfill the window’s needs. If you need the true height immediately after creating a widget, invoke update to force the geometry manager to arrange it, or use winfo :reqheight to get the window’s requested height instead of its actual height.
Returns a hexadecimal string indicating the X identifier for window.
Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for the display of the invoking application.
Returns 1 if window is currently mapped, 0 otherwise.
Returns window’s name (i.e. its name within its parent, as opposed to its full path name). The command winfo :name . will return the name of the application.
Returns the path name of window’s parent, or an empty string if window is the main window of the application.
Returns the path name of the window whose X identifier is id. Id must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application.
Returns the number of pixels in window corresponding to the distance given by number. Number may be specified in any of the forms acceptable to Tk_GetPixels, such as “2.0c” or “1i”. The result is rounded to the nearest integer value; for a fractional result, use winfo :fpixels.
Returns a decimal string giving window’s requested height, in pixels. This is the value used by window’s geometry manager to compute its geometry.
Returns a decimal string giving window’s requested width, in pixels. This is the value used by window’s geometry manager to compute its geometry.
Returns a list containing three decimal values, which are the red, green, and blue intensities that correspond to color in the window given by window. Color may be specified in any of the forms acceptable for a color option.
Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of window’s border (or window if it has no border).
Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of window’s border (or window if it has no border).
Returns the name of the screen associated with window, in the form displayName.screenIndex.
Returns a decimal string giving the number of cells in the default color map for window’s screen.
Returns a decimal string giving the depth of the root window of window’s screen (number of bits per pixel).
Returns a decimal string giving the height of window’s screen, in pixels.
Returns a decimal string giving the height of window’s screen, in millimeters.
Returns a decimal string giving the width of window’s screen, in millimeters.
Returns one of the following strings to indicate the default visual type for window’s screen: directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor.
Returns a decimal string giving the width of window’s screen, in pixels.
Returns the path name of the top-level window containing window.
Returns one of the following strings to indicate the visual type for window: directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor.
Returns the height of the virtual root window associated with window if there is one; otherwise returns the height of window’s screen.
Returns the width of the virtual root window associated with window if there is one; otherwise returns the width of window’s screen.
Returns the x-offset of the virtual root window associated with window, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for window.
Returns the y-offset of the virtual root window associated with window, relative to the root window of its screen. This is normally either zero or negative. Returns 0 if there is no virtual root window for window.
Returns a decimal string giving window’s width in pixels. When a window is first created its width will be 1 pixel; the width will eventually be changed by a geometry manager to fulfill the window’s needs. If you need the true width immediately after creating a widget, invoke update to force the geometry manager to arrange it, or use winfo :reqwidth to get the window’s requested width instead of its actual width.
Returns a decimal string giving the x-coordinate, in window’s parent, of the upper-left corner of window’s border (or window if it has no border).
Returns a decimal string giving the y-coordinate, in window’s parent, of the upper-left corner of window’s border (or window if it has no border).
atom, children, class, geometry, height, identifier, information, interpreters, mapped, parent, path name, screen, virtual root, width, window