winfo - Return window-related information
$widget->method(?arg arg ...?)
These methods are used to retrieve information about windows
managed by Tk. They can take any of a number of different forms,
depending on the method. The legal forms are:
- $widget->atom(name)
- 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.
- $widget->atomname(id)
- Returns the textual name for the atom whose integer identifier is
id.
This command is the inverse of the $widget->atom command.
It generates an error if no such atom exists.
- $widget->cells
- Returns a decimal string giving the number of cells in the
color map for $widget.
- $widget->children
- Returns a list containing all the children
of $widget. Top-level windows are returned as children
of their logical parents.
- $widget->class
- Returns the class name for $widget.
- $widget->colormapfull
- Returns 1 if the colormap for $widget is known to be full, 0
otherwise. The colormap for a window is ``known'' to be full if the last
attempt to allocate a new color on that window failed and this
application hasn't freed any colors in the colormap since the
failed allocation.
- $widget->containing(rootX,rootY)
- Returns 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.
- $widget->depth
- Returns a decimal string giving the depth of $widget (number
of bits per pixel).
- Exists($widget)
- Returns 1 if there exists a window for $widget, 0 if no such
window exists.
- $widget->fpixels(number)
- Returns a floating-point value giving the number of pixels
in $widget 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
$widget->pixels.
- $widget->geometry
- Returns the geometry for $widget, in the form
widthxheight+x+y. All dimensions are
in pixels.
- $widget->height
- Returns a decimal string giving $widget'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 $widget->reqheight to get the window's requested height
instead of its actual height.
- $widget->id
- Returns a hexadecimal string indicating the X identifier for $widget.
- $widget->interps
- Returns a list whose members are the names of all Tcl interpreters
(e.g. all Tk-based applications) currently registered for
a particular display.
The return value refers
to the display of $widget.
- $widget->ismapped
- Returns 1 if $widget is currently mapped, 0 otherwise.
- $widget->manager
- Returns the name of the geometry manager currently
responsible for $widget, or an empty string if $widget
isn't managed by any geometry manager.
The name is usually the name of the method for the geometry
manager, such as pack or place.
If the geometry manager is a widget, such as canvases or text, the
name is the widget's class command, such as canvas.
- $widget->name
- Returns $widget's name (i.e. its name within its parent, as opposed
to its full path name).
The command $mainwin->name will return the name of the application.
- $widget->parent
- Returns $widget's parent, or an empty string
if $widget is the main window of the application.
- $widget->pathname(id)
- 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.
The identifier is looked
up on the display of $widget.
- $widget->pixels(number)
- Returns the number of pixels in $widget 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 $widget->fpixels.
- $widget->pointerx
- If the mouse pointer is on the same screen as $widget, returns the
pointer's x coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position is
measured in the virtual root.
If the mouse pointer isn't on the same screen as $widget then
-1 is returned.
- $widget->pointerxy
- If the mouse pointer is on the same screen as $widget, returns a list
with two elements, which are the pointer's x and y coordinates measured
in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer isn't on the same screen as $widget then
both of the returned coordinates are -1.
- $widget->pointery
- If the mouse pointer is on the same screen as $widget, returns the
pointer's y coordinate, measured in pixels in the screen's root window.
If a virtual root window is in use on the screen, the position
is computed in the virtual root.
If the mouse pointer isn't on the same screen as $widget then
-1 is returned.
- $widget->reqheight
- Returns a decimal string giving $widget's requested height,
in pixels. This is the value used by $widget's geometry
manager to compute its geometry.
- $widget->reqwidth
- Returns a decimal string giving $widget's requested width,
in pixels. This is the value used by $widget's geometry
manager to compute its geometry.
- $widget->rgb(color)
- Returns a list containing three decimal values, which are the
red, green, and blue intensities that correspond to color in
the window given by $widget. Color
may be specified in any of the forms acceptable for a color
option.
- $widget->rootx
- Returns a decimal string giving the x-coordinate, in the root
window of the screen, of the
upper-left corner of $widget's border (or $widget if it
has no border).
- $widget->rooty
- Returns a decimal string giving the y-coordinate, in the root
window of the screen, of the
upper-left corner of $widget's border (or $widget if it
has no border).
- $widget->screen
- Returns the name of the screen associated with $widget, in
the form displayName.screenIndex.
- $widget->screencells
- Returns a decimal string giving the number of cells in the default
color map for $widget's screen.
- $widget->screendepth
- Returns a decimal string giving the depth of the root window
of $widget's screen (number of bits per pixel).
- $widget->screenheight
- Returns a decimal string giving the height of $widget's screen,
in pixels.
- $widget->screenmmheight
- Returns a decimal string giving the height of $widget's screen,
in millimeters.
- $widget->screenmmwidth
- Returns a decimal string giving the width of $widget's screen,
in millimeters.
- $widget->screenvisual
- Returns one of the following strings to indicate the default visual
class for $widget's screen: directcolor, grayscale,
pseudocolor, staticcolor, staticgray, or
truecolor.
- $widget->screenwidth
- Returns a decimal string giving the width of $widget's screen,
in pixels.
- $widget->server
- Returns a string containing information about the server for
$widget's display. The exact format of this string may vary
from platform to platform. For X servers the string
has the form ``XmajorRminor vendor vendorVersion''
where major and minor are the version and revision
numbers provided by the server (e.g., X11R5), vendor
is the name of the vendor for the server, and vendorRelease
is an integer release number provided by the server.
- $widget->toplevel
- Returns the path name of the top-level window containing $widget.
- $widget->viewable
- Returns 1 if $widget and all of its ancestors up through the
nearest toplevel window are mapped. Returns 0 if any of these
windows are not mapped.
- $widget->visual
- Returns one of the following strings to indicate the visual
class for $widget: directcolor, grayscale,
pseudocolor, staticcolor, staticgray, or
truecolor.
- $widget->visualsavailable
- Returns a list whose elements describe the visuals available for
$widget's screen.
Each element consists of a visual class followed by an integer depth.
The class has the same form as returned by $widget->visual.
The depth gives the number of bits per pixel in the visual.
- $widget->vrootheight
- Returns the height of the virtual root window associated with $widget
if there is one; otherwise returns the height of $widget's screen.
- $widget->vrootwidth
- Returns the width of the virtual root window associated with $widget
if there is one; otherwise returns the width of $widget's screen.
- $widget->vrootx
- Returns the x-offset of the virtual root window associated with $widget,
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 $widget.
- $widget->vrooty
- Returns the y-offset of the virtual root window associated with $widget,
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 $widget.
- $widget->width
- Returns a decimal string giving $widget'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 $widget->reqwidth to get the window's requested width
instead of its actual width.
- $widget->x
- Returns a decimal string giving the x-coordinate, in $widget's
parent, of the
upper-left corner of $widget's border (or $widget if it
has no border).
- $widget->y
- Returns a decimal string giving the y-coordinate, in $widget's
parent, of the
upper-left corner of $widget's border (or $widget if it
has no border).
atom, children, class, geometry, height, identifier, information, interpreters,
mapped, parent, path name, screen, virtual root, width, window