#self. 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, ""), winfoheight(self) Return height of this widget. winfogeometry(self) Return geometry string for this widget in the form 'widthxheight+X+Y'. winfofpixels(self, number) Return the number of pixels for the given distance NUMBER (e.g. Self.voices = ('topone','toptwo','topthree')į0 = tk.Frame(self, bg='SlateGray4', padx=5,pady=5)īts = [("Call winfo_exists", 7, self.on_winfo_exists, ""), winfoexists(self) Return true if this widget exists. 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. winfoexists () is supposed to return 1 or 0 depending on the existence of a widget when I use. However, I cannot test the existence of a Toplevel by passing the name of this to winfo_exists() method. The tkinter.ttk module provides access to the Tk themed widget set, introduced in Tk 8.5. I’m trying to test the existence of a toplevel using the winfo_exists() method made available by Tkinter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |