I'm learning wxpython for one of my project, and I have a problem.. How do I store the value of the RadioButton once I click my button?
I have a
class SerialFrame(wx.Frame):
inside that I have
def __init__(self, parent, title):
super(SerialFrame, self).__init__(parent, title=title,
size=(550, 400))
self.SetMinSize(self.GetSize())
self.InitUI()
self.Center()
self.Show()
the InitUI method sets up my UI which has a bunch of stuff including 3 Radio Buttons and a button like so
def InitUI(self):
mypanel = wx.Panel(self, -1)
...
baudRadioButton1 = wx.RadioButton(mypanel, -1, '9600', style=wx.RB_GROUP)
baudRadioButton2 = wx.RadioButton(mypanel, -1, '14400')
baudRadioButton3 = wx.RadioButton(mypanel, -1, '19200')
...
stopButton = wx.Button(mypanel, 2, label='Stop', size = (70,20))
...
mypanel.Bind(wx.EVT_BUTTON, self.clickStart, id=1)
mypanel.Bind(wx.EVT_RADIOBUTTON, self.setRadioValues, id=baudRadioButton1.GetId())
I tried something like
def clickStart(self, event):
baudRate1 = str(self.baudRadioButton1.GetValue())
self.Close(True)
But it won't work. P.S. my OOP knowledge is still limited.