{"id":6310,"date":"2022-12-20T18:58:08","date_gmt":"2022-12-20T21:58:08","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/winfo-mann\/"},"modified":"2022-12-20T18:58:08","modified_gmt":"2022-12-20T21:58:08","slug":"winfo-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/winfo-mann\/","title":{"rendered":"winfo (mann)"},"content":{"rendered":"<h1 align=\"center\">winfo<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">winfo \u2212 Return window-related information<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>winfo<\/b> <i>option<\/i> ?<i>arg arg &#8230;<\/i>? ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>winfo<\/b> command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the <i>option<\/i> argument. The legal forms are: <b><br \/> winfo atom<\/b> ?<b>\u2212displayof<\/b> <i>window<\/i>? <i>name<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the integer identifier for the atom whose name is <i>name<\/i>. If no atom exists with the name <i>name<\/i> then a new one is created. If the <b>\u2212displayof<\/b> option is given then the atom is looked up on the display of <i>window<\/i>; otherwise it is looked up on the display of the application\u2019s main window.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo atomname<\/b> ?<b>\u2212displayof<\/b> <i>window<\/i>? <i>id<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the textual name for the atom whose integer identifier is <i>id<\/i>. If the <b>\u2212displayof<\/b> option is given then the identifier is looked up on the display of <i>window<\/i>; otherwise it is looked up on the display of the application\u2019s main window. This command is the inverse of the <b>winfo atom<\/b> command. It generates an error if no such atom exists.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo cells<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the number of cells in the color map for <i>window<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo children<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a list containing the path names of all the children of <i>window<\/i>. Top-level windows are returned as children of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the <b>wm stackorder<\/b> command to query the stacking order of Top-level windows.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo class<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the class name for <i>window<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo colormapfull<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns 1 if the colormap for <i>window<\/i> is known to be full, 0 otherwise. The colormap for a window is \u201cknown\u201d to be full if the last attempt to allocate a new color on that window failed and this application has not freed any colors in the colormap since the failed allocation.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo containing<\/b> ?<b>\u2212displayof<\/b> <i>window<\/i>? <i>rootX rootY<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the path name for the window containing the point given by <i>rootX<\/i> and <i>rootY<\/i>. <i>RootX<\/i> and <i>rootY<\/i> are specified in screen units (i.e. any form acceptable to <b>Tk_GetPixels<\/b>) 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 the <b>\u2212displayof<\/b> option is given then the coordinates refer to the screen containing <i>window<\/i>; otherwise they refer to the screen of the application\u2019s main window. If no window in this application contains the point then an empty string is returned. An empty string is also returned if the point lies in the title bar or border of its highest containing toplevel in this application. (Note that with some window managers the borders may be invisible.) In selecting the containing window, children are given higher priority than parents and among siblings the highest one in the stacking order is chosen.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo depth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the depth of <i>window<\/i> (number of bits per pixel).<\/p>\n<p style=\"margin-left:11%;\"><b>winfo exists<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns 1 if there exists a window named <i>window<\/i>, 0 if no such window exists.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo fpixels<\/b> <i>window number<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a floating-point value giving the number of pixels in <i>window<\/i> corresponding to the distance given by <i>number<\/i>. <i>Number<\/i> may be specified in any of the forms acceptable to <b>Tk_GetScreenMM<\/b>, such as \u201c2.0c\u201d or \u201c1i\u201d. The return value may be fractional; for an integer value, use <b>winfo pixels<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo geometry<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the geometry for <i>window<\/i>, in the form <i>width<\/i><b>x<\/b><i>height<\/i><b>+<\/b><i>x<\/i><b>+<\/b><i>y<\/i>. All dimensions are in pixels.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo height<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving <i>window<\/i>\u2019s 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 fulfil the window\u2019s needs. If you need the true height immediately after creating a widget, invoke <b>update<\/b> to force the geometry manager to arrange it, or use <b>winfo reqheight<\/b> to get the window\u2019s requested height instead of its actual height.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo id<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a hexadecimal string giving a low-level platform-specific identifier for <i>window<\/i>. On Unix platforms, this is the X window identifier. Under Windows, this is the Windows HWND. On the Macintosh the value has no meaning outside Tk.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo interps<\/b> ?<b>\u2212displayof<\/b> <i>window<\/i>?<\/p>\n<p style=\"margin-left:22%;\">Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for a particular display. If the <b>\u2212displayof<\/b> option is given then the return value refers to the display of <i>window<\/i>; otherwise it refers to the display of the application\u2019s main window.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo ismapped<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns <b>1<\/b> if <i>window<\/i> is currently mapped, <b>0<\/b> otherwise.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo manager<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the name of the geometry manager currently responsible for <i>window<\/i>, or an empty string if <i>window<\/i> is not managed by any geometry manager. The name is usually the name of the Tcl command for the geometry manager, such as <b>pack<\/b> or <b>place<\/b>. If the geometry manager is a widget, such as canvases or text, the name is the widget\u2019s class command, such as <b>canvas<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo name<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns <i>window<\/i>\u2019s name (i.e. its name within its parent, as opposed to its full path name). The command <b>winfo name .<\/b> will return the name of the application.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo parent<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the path name of <i>window<\/i>\u2019s parent, or an empty string if <i>window<\/i> is the main window of the application.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo pathname<\/b> ?<b>\u2212displayof<\/b> <i>window<\/i>? <i>id<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the path name of the window whose X identifier is <i>id<\/i>. <i>Id<\/i> must be a decimal, hexadecimal, or octal integer and must correspond to a window in the invoking application. If the <b>\u2212displayof<\/b> option is given then the identifier is looked up on the display of <i>window<\/i>; otherwise it is looked up on the display of the application\u2019s main window.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo pixels<\/b> <i>window number<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the number of pixels in <i>window<\/i> corresponding to the distance given by <i>number<\/i>. <i>Number<\/i> may be specified in any of the forms acceptable to <b>Tk_GetPixels<\/b>, such as \u201c2.0c\u201d or \u201c1i\u201d. The result is rounded to the nearest integer value; for a fractional result, use <b>winfo fpixels<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo pointerx<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">If the mouse pointer is on the same screen as <i>window<\/i>, returns the pointer\u2019s x coordinate, measured in pixels in the screen\u2019s 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 is not on the same screen as <i>window<\/i> then -1 is returned.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo pointerxy<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">If the mouse pointer is on the same screen as <i>window<\/i>, returns a list with two elements, which are the pointer\u2019s x and y coordinates measured in pixels in the screen\u2019s 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 is not on the same screen as <i>window<\/i> then both of the returned coordinates are \u22121.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo pointery<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">If the mouse pointer is on the same screen as <i>window<\/i>, returns the pointer\u2019s y coordinate, measured in pixels in the screen\u2019s 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 is not on the same screen as <i>window<\/i> then -1 is returned.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo reqheight<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving <i>window<\/i>\u2019s requested height, in pixels. This is the value used by <i>window<\/i>\u2019s geometry manager to compute its geometry.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo reqwidth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving <i>window<\/i>\u2019s requested width, in pixels. This is the value used by <i>window<\/i>\u2019s geometry manager to compute its geometry.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo rgb<\/b> <i>window color<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a list containing three decimal values in the range 0 to 65535, which are the red, green, and blue intensities that correspond to <i>color<\/i> in the window given by <i>window<\/i>. <i>Color<\/i> may be specified in any of the forms acceptable for a color option.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo rootx<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the x-coordinate, in the root window of the screen, of the upper-left corner of <i>window<\/i>\u2019s border (or <i>window<\/i> if it has no border).<\/p>\n<p style=\"margin-left:11%;\"><b>winfo rooty<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the y-coordinate, in the root window of the screen, of the upper-left corner of <i>window<\/i>\u2019s border (or <i>window<\/i> if it has no border).<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screen<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the name of the screen associated with <i>window<\/i>, in the form <i>displayName<\/i>.<i>screenIndex<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screencells<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the number of cells in the default color map for <i>window<\/i>\u2019s screen.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screendepth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the depth of the root window of <i>window<\/i>\u2019s screen (number of bits per pixel).<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screenheight<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the height of <i>window<\/i>\u2019s screen, in pixels.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screenmmheight<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the height of <i>window<\/i>\u2019s screen, in millimeters.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screenmmwidth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the width of <i>window<\/i>\u2019s screen, in millimeters.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screenvisual<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns one of the following strings to indicate the default visual class for <i>window<\/i>\u2019s screen: <b>directcolor<\/b>, <b>grayscale<\/b>, <b>pseudocolor<\/b>, <b>staticcolor<\/b>, <b>staticgray<\/b>, or <b>truecolor<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo screenwidth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the width of <i>window<\/i>\u2019s screen, in pixels.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo server<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a string containing information about the server for <i>window<\/i>\u2019s display. The exact format of this string may vary from platform to platform. For X servers the string has the form \u201c<b>X<\/b><i>major<\/i><b>R<\/b><i>minor vendor vendorVersion<\/i>\u201d where <i>major<\/i> and <i>minor<\/i> are the version and revision numbers provided by the server (e.g., <b>X11R5<\/b>), <i>vendor<\/i> is the name of the vendor for the server, and <i>vendorRelease<\/i> is an integer release number provided by the server.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo toplevel<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the path name of the top-of-hierarchy window containing <i>window<\/i>. In standard Tk this will always be a <b>toplevel<\/b> widget, but extensions may create other kinds of top-of-hierarchy widgets.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo viewable<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns 1 if <i>window<\/i> and all of its ancestors up through the nearest toplevel window are mapped. Returns 0 if any of these windows are not mapped.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo visual<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns one of the following strings to indicate the visual class for <i>window<\/i>: <b>directcolor<\/b>, <b>grayscale<\/b>, <b>pseudocolor<\/b>, <b>staticcolor<\/b>, <b>staticgray<\/b>, or <b>truecolor<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo visualid<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the X identifier for the visual for <i>window<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo visualsavailable<\/b> <i>window<\/i> ?<b>includeids<\/b>?<\/p>\n<p style=\"margin-left:22%;\">Returns a list whose elements describe the visuals available for <i>window<\/i>\u2019s screen. Each element consists of a visual class followed by an integer depth. The class has the same form as returned by <b>winfo visual<\/b>. The depth gives the number of bits per pixel in the visual. In addition, if the <b>includeids<\/b> argument is provided, then the depth is followed by the X identifier for the visual.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo vrootheight<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the height of the virtual root window associated with <i>window<\/i> if there is one; otherwise returns the height of <i>window<\/i>\u2019s screen.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo vrootwidth<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the width of the virtual root window associated with <i>window<\/i> if there is one; otherwise returns the width of <i>window<\/i>\u2019s screen.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo vrootx<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the x-offset of the virtual root window associated with <i>window<\/i>, 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 <i>window<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo vrooty<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns the y-offset of the virtual root window associated with <i>window<\/i>, 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 <i>window<\/i>.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo width<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving <i>window<\/i>\u2019s 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 fulfil the window\u2019s needs. If you need the true width immediately after creating a widget, invoke <b>update<\/b> to force the geometry manager to arrange it, or use <b>winfo reqwidth<\/b> to get the window\u2019s requested width instead of its actual width.<\/p>\n<p style=\"margin-left:11%;\"><b>winfo x<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the x-coordinate, in <i>window<\/i>\u2019s parent, of the upper-left corner of <i>window<\/i>\u2019s border (or <i>window<\/i> if it has no border).<\/p>\n<p style=\"margin-left:11%;\"><b>winfo y<\/b> <i>window<\/i><\/p>\n<p style=\"margin-left:22%;\">Returns a decimal string giving the y-coordinate, in <i>window<\/i>\u2019s parent, of the upper-left corner of <i>window<\/i>\u2019s border (or <i>window<\/i> if it has no border).<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Print where the mouse pointer is and what window it is currently over:<\/p>\n<p style=\"margin-left:22%;\">lassign [<b>winfo pointerxy<\/b> .] x y <br \/> puts \u2212nonewline &#8220;Mouse pointer at ($x,$y) which is &#8221; <br \/> set win [<b>winfo containing<\/b> $x $y] <br \/> if {$win eq &#8220;&#8221;} { <br \/> puts &#8220;over no window&#8221; <br \/> } else { <br \/> puts &#8220;over $win&#8221; <br \/> }<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">atom, children, class, geometry, height, identifier, information, interpreters, mapped, parent, path name, screen, virtual root, width, window<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  winfo \u2212 Return window-related information <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2635,2910],"class_list":["post-6310","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-mann","tag-winfo"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6310"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6310\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}