12.07.2015 Views

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

w.winfo_containing ( rootX, rootY, displayof=0 )This method is used to find the window that contains point (rootX; rootY). If thedisplayof option is false, the coordinates are relative to the application’s root window;if true, the coordinates are treated as relative to the top-level window that contains w. Ifthe specified point is in one of the application’s top-level window, this method returnsthat window; otherwise it returns None.w.winfo_depth()Returns the number of bits per pixel in w’s display.w.winfo_fpixels ( number )For any dimension number (see Dimensions, above), this method returns that distance inpixels on w’s display, as a floating-point number.w.winfo_geometry()Returns the geometry string describing the size and on-screen location of w as a string"wxh+x+y", where w is the width, h is the height, and the upper left corner of the widgetis at (x, y) relative to the upper left corner of its top-level window. Warning: the geometryis not accurate until the application has updated its idle tasks. In particular, all geometriesare initially "1x1+0+0" until the widgets and geometry manager have negotiated theirsizes and positions. See the .update_idletasks() method, above, in this section to seehow to insure that the widget’s geometry is up to date.w.winfo_height()Returns the current height of w in pixels. See the remarks on geometry updating under.winfo_geometry(), above.w.winfo_id()Returns an integer that uniquely identifies w within its top-level window. You will needthis <strong>for</strong> the .winfo_pathname() method, below.w.winfo_ismapped()This method returns true if w is mapped, false otherwise. A widget is mapped if it hasbeen gridded (or placed or packed, if you are using one of the other geometry managers)into its parent, and if its parent is mapped, and so on up to the top-level window.w.winfo_manager()If w has not been gridded (or placed via one of the othergeometry managers), this method returns an empty string. If w has been gridded orotherwise placed, it returns a string naming the geometry manager, such as "grid".w.winfo_name()This method returns w’s name relative to its parent. Widget names have a hierarchical“path name” structure somewhat like path names in a file system. A widget that is thechild of a top-level window has a name of the <strong>for</strong>m ".n", where n is the widget’s nameas returned by .winfo_name(). Any other widget has a name of the <strong>for</strong>m p p .n, wherep p is the path name of its parent and n is its own name. See .winfo_pathname(), below,to find out how to obtain a widget’s path name.w.winfo_parent()Returns w’s parent’s path name, or an empty string if w is a top-level window..winfo_name(), above, <strong>for</strong> more on widget path names.SeeNew Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: Universal widget methods Page 67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!