Python Forum
[Tkinter] RadioButton
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] RadioButton
#1
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)
Reply
#2
Set the StringVar to the default value.
self.Radio_Value2 = StringVar()
self.Radio_Value2.set('Yes')
Maryan likes this post
Reply
#3
(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!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to dynamically change radiobutton text kenwatts275 2 949 Mar-05-2021, 02:25 AM
Last Post: deanhystad
  Python3 tkinter radiobutton problem Nick_tkinter 14 1,351 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  [Tkinter] How to create radiobutton in numpy gui python? luthfidali 2 1,129 May-23-2020, 10:35 AM
Last Post: timo
  Tkinter: increasing numbers and Radiobutton issue PeroPuri 1 774 Apr-13-2020, 05:48 PM
Last Post: deanhystad
  [PyQt] how to deselect radiobutton in pyqt5 atlass218 3 5,832 Oct-23-2019, 03:25 PM
Last Post: Denni
  [Tkinter] Clicking a RadioButton in a for Loop & Getting the Appropriate Return Vicolas 1 2,849 Feb-02-2019, 01:53 AM
Last Post: woooee
  [Tkinter] Radiobutton in Tkinter not Updating Variable from Value Aidan54321 1 5,195 Jun-16-2017, 11:08 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020