I'm trying to create a settings window, with multiple groups of TkInter Radiobuttons. They should modify a text variable that I can work with later on.
I have the following code:
# radiobutton group 1
settingSort = ""
settingSortRadio1 = tkinter.Radiobutton(settingsWindow, text="Frequency", variable=settingSort, value="freq")
settingSortRadio1.select()
settingSortRadio1.pack()
settingSortRadio2 = tkinter.Radiobutton(settingsWindow, text="Alphabetical", variable=settingSort, value="alpha")
settingSortRadio2.pack()
#radiobutton group 2
settingAnalyseRadio1 = tkinter.Radiobutton(settingsWindow, text="Word frequency", variable=settingAnalyse, value="wfreq")
settingAnalyseRadio1.select()
settingAnalyseRadio1.pack()
settingAnalyseRadio2 = tkinter.Radiobutton(settingsWindow, text="Letter frequency", variable=settingAnalyse, value="lfreq")
settingAnalyseRadio2.pack()
However, these buttons all seem to be part of the same group still. Selecting a button in group 1 will deselect all others in the window (including in group 2), and vice versa.
How can I fix this?