![]() winfo_visualsavailable( includeids=True ) Returns the X identifier for the visual for window. Returns one of the following strings to indicate the visual class for window: directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor. Returns one of the following strings to indicate the default visual class for window 's screen: directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor. Returns a decimal string giving the width of window's screen, in millimeters. Returns a decimal string giving the height of window's screen, in millimeters. Returns a decimal string giving the height of window's screen, in pixels. 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 number of cells in the default color map for window's screen. 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 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). Color may be specified in any of the forms acceptable for a color option. Returns a list containing three decimal values in the range 0 to 65535, which are the red, green, and blue intensities that correspond to color in the window given by window. This is the value used by windows geometry manager to compute its geometry. Returns a decimal string giving window s requested width, in pixels. Returns a decimal string giving window s requested height, in pixels. If the mouse pointer is on the same screen as window, returns the pointer's y coordinate, measured in pixels in the screen's root window. If the mouse pointer is on the same screen as window, 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 the mouse pointer is on the same screen as window, returns the pointer's x coordinate, measured in pixels in the screen's root window. The result is rounded to the nearest integer value for a fractional result, use winfo_fpixels(). Number may be specified in any of the forms acceptable to Screen Units, such as "2.0c" or "1i". Returns the number of pixels in window corresponding to the distance given by number. Returns the path name of window's parent, or an empty string if window is the main window of the application. The name is usually the name of the Tkinter method for the geometry manager, such as pack() or place(). Returns the name of the geometry manager currently responsible for window, or an empty string if window is not managed by any geometry manager. Returns 1 if window is currently mapped, 0 otherwise. On the Macintosh the value has no meaning outside Tkinter. On Unix platforms, this is the X window identifier. winfo_id() br> Returns a hexadecimal string giving a low-level platform-specific identifier for window. Returns the geometry for window, in the form width x height + x + y. The return value may be fractional for an integer value, use winfo_pixels()''. number' may be specified in any of the forms acceptable to Screen Units, such as "2.0c" or "1i". ![]() Returns a floating-point value giving the number of pixels in window corresponding to the distance given by number. Returns 1 if there exists a window named window, an error is returned if no such window exists. ![]() Returns a decimal string giving the depth of window (number of bits per pixel). Returns a decimal string giving the number of cells in the color map for window. It can take any of a number of different forms. If we click the button, the output will show the name of the widget on the screen.The winfo() method is used to retrieve information about windows managed by Tkinter. If we run the above code, it will display a window with a button. # Create an instance of tkinter frame or windowĬanvas=Canvas(win, width=500, height=300)īutton(win, text="Click", command=on_click).pack() We can print the name by using it inside the print() function. ![]() If we want to get a widget's name in an event, then it can be achieved by using event.widget keywords inside a function. Let us suppose that we have defined some widgets in our application. Tkinter provides widgets that can be used for constructing the visual and functional representation of the application. Tkinter is a Python library that is used to create and develop functional GUI-based applications.
0 Comments
Leave a Reply. |