I have several radio buttons which have different values, and are tight to one variable. Even though the variable should take button's value when selected, it doesn't. Here is the code I'm using.
mimeType = StringVar()
wave = StringVar(value="audio/wav")
mp3 = StringVar(value='audio/mp3')
mp4 = StringVar(value='audio/mp4')
mp2 = StringVar(value='audio/mp2')
flac = StringVar(value='audio/flac')
m4a = StringVar(value='audio/m4a')
MP3 = Radiobutton(window, text = "MP3 Format", variable = mimeType,
height=5,
width = 20, value=mp3,bg = "#36DEE5", activebackground= "#36DEE5",
MP4 = Radiobutton(window, text = "MP4 Format", variable = mimeType,
height=5,
width = 20,value=mp4,bg = "#36DEE5", activebackground= "#36DEE5")
MP2 = Radiobutton(window, text = "MP2 Format", variable = mimeType,
height=5,
width = 20,value=mp2,bg = "#36DEE5", activebackground= "#36DEE5")
WAV = Radiobutton(window, text = "WAV Format", variable = mimeType,
height=5,
width = 20, value=wave,bg = "#36DEE5", activebackground= "#36DEE5")
M4A = Radiobutton(window, text = "M4A Format", variable = mimeType,
height=5,
width = 20,value=m4a,bg = "#36DEE5", activebackground= "#36DEE5",
print(mimeType.get()) # This doesn't return anything either
Special note: print(mimeType.get()) doesn't return anything!
So what I want is, the variable mimeType should take the value of Radio Buttons when selected.
