CustomTkinter
CustomTkinter copied to clipboard
Crashing when destroying a whole frame because of non-existing attribute
Traceback:
File "C:\path\to\project\APP", line 231, in manualInterface
self.erase()
File "C:\path\to\project\APP", line 160, in erase
child.destroy()
File "C:\path\to\project\win-venv\Lib\site-packages\customtkinter\windows\widgets\core_widget_classes\ctk_base_class.py", line 98, in destroy
tkinter.Frame.destroy(self)
File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 2655, in destroy
for c in list(self.children.values()): c.destroy()
^^^^^^^^^^^
File "C:\path\to\project\win-venv\Lib\site-packages\customtkinter\windows\widgets\core_widget_classes\ctk_base_class.py", line 98, in destroy
tkinter.Frame.destroy(self)
File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\tkinter\__init__.py", line 2655, in destroy
for c in list(self.children.values()): c.destroy()
^^^^^^^^^^^
File "C:\path\to\project\win-venv\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 179, in destroy
if isinstance(self._font, CTkFont):
^^^^^^^^^^
AttributeError: 'CTkButton' object has no attribute '_font'. Did you mean: '_root'?
The self.erase() function (which works completely fine in any other call) is defined as follows:
def erase(self):
for child in self.mainFrame.winfo_children():
child.destroy()