Jun-15-2023, 09:50 PM
I am using code to try to learn python. I am getting an AttributeError which I cannot figure out. Here is the error.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "c:\Python\gui_cell_set_state.py", line 31, in _on_click
self.set_state(not self.active)
AttributeError: 'Cell' object has no attribute 'active'
I have copied the code exactly as it was written in the instructions and it seems to work until I try to Click on a box. That is the code presents the canvas with its boxes properly but when I try to click on a box to change its state, the error is thrown up. I cannot see what is causing this error. Would appreciate any help I could get. Thanks. The code is below.
david
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2800.0_x64__qbz5n2kfra8p0\lib\tkinter\__init__.py", line 1921, in __call__
return self.func(*args)
File "c:\Python\gui_cell_set_state.py", line 31, in _on_click
self.set_state(not self.active)
AttributeError: 'Cell' object has no attribute 'active'
I have copied the code exactly as it was written in the instructions and it seems to work until I try to Click on a box. That is the code presents the canvas with its boxes properly but when I try to click on a box to change its state, the error is thrown up. I cannot see what is causing this error. Would appreciate any help I could get. Thanks. The code is below.
david
Attached Files
gui_cell_set_state.py (Size: 2.67 KB / Downloads: 125)