Python Forum

Full Version: RadioButton
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I run the app, all values are selected. How can I fix this?

self.Radio_Value2 = StringVar()
self.radb4 = Radiobutton(frame, value = 'Yes', text = 'Yes', variable = self.Radio_Value2)
self.radb4.grid(row = 3, column = 0, sticky = W)
self.radb5 = Radiobutton(frame, value = 'No', text = 'No', variable = self.Radio_Value2)
self.radb5.grid(row = 3, column = 1)
self.radb6 = Radiobutton(frame, value = 'Not Sure', text = 'Not Sure', variable = self.Radio_Value2)
self.radb6.grid(row = 3, column = 2)
Set the StringVar to the default value.
self.Radio_Value2 = StringVar()
self.Radio_Value2.set('Yes')
(Oct-23-2020, 09:26 PM)Yoriz Wrote: [ -> ]Set the StringVar to the default value.
self.Radio_Value2 = StringVar()
self.Radio_Value2.set('Yes')

Thank you!