The root window and other Toplevel windows provide additional methods. aka config destroy () keys () lower (belowThisNone) tkraise (aboveThisNone). Basic Widget Methods The following methods are provided by all widgets (including the root window). #self. Methods: Inherited from Widget: bindtags (tagListNone) cget (key) configure (cnfNone, kw). Self.protocol("WM_DELETE_WINDOW", self.on_exit) Msg = "".format(self.winfo_name().title()) ("Test exist", 0, self.on_test_exist, ""),įor index, text in enumerate(self.voices):į0.pack(fill=tk.BOTH, expand=1, padx=5, pady=5)į2.pack(side=tk.RIGHT, fill=tk.Y, padx=5, pady=5, expand=0)į1.pack(side=tk.LEFT, fill=tk.Y, padx=5, pady=5, expand=0) ("Get winfo_children", 0, self.on_get_winfo_children, ""), If self.nametowidget(DICT_TOPLEVELS).winfo_exists():įile "/usr/lib/python3.7/tkinter/_init_.py", line 1353, in nametowidgetīasically in an application with many Toplevels, how do you see if a certain Toplevel is open? Selecting a Toplevel to test using the radiobox on the right happens that if the relative Toplevel is open the function work fine, otherwise generates the following error: Exception in Tkinter callbackįile "/usr/lib/python3.7/tkinter/_init_.py", line 1705, in _call_įile "/home/bc/Desktop/simple_app.py", line 113, in on_test_exist Pressing on the first appears a mask where we can, by pressing the relevant buttons, see the execution of both the winfo_exists() method and the winfo_children() method. When you open the app, four buttons are shown. I enclose a script to better clarify what I would like to do. However, I cannot test the existence of a Toplevel by passing the name of this to winfo_exists() method. I’m trying to test the existence of a toplevel using the winfo_exists() method made available by Tkinter.