I'm trying to make a GUI for my app, but I have hit a roadblock when trying to make a settings Toplevel. This Toplevel comes with tabs and setting buttons that start at the same state their respective settings are stored as from last settings/defaults.
Here is the exception I am currently getting:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Python39\lib\tkinter\__init__.py", line 1885, in __call__
return self.func(*args)
File "KMIU 4\kmiu_dv7.pyw", line 38, in settings
sett.display(main)
File "KMIU 4\bk\settings.py", line 54, in __init__
self.windowsettings(tab2)
File "KMIU 4\bk\settings.py", line 23, in windowsettings
if settings['Fullscreen'].get(): fs_butt.select()
AttributeError: 'Checkbutton' object has no attribute 'select'
Here is the bit of code that is causing the issue:
def windowsettings(self, tab):
global settings
text = Label(tab, text ="sample text")
text.grid(columnspan = 2)
fs_butt = Checkbutton(
tab,
text="Fullscreen",
command=lambda: settings['Fullscreen'].set(not settings['Fullscreen'].get()))
print(settings)
fs_butt.grid(row=1)
if settings['Fullscreen'].get(): fs_butt.select()