I have a newbie question about wxPython
I am trying to extract values out of fields with my wxPanel. I am not sure
how to do this. The values that I am interested in are the two values in
the wxTectCtrl and the value in the wxChoice.
Here is my code:
from wxPython.wx import *
class Preq_form(wxPanel):
def __init__(self, parent, id):
wxPanel.__init__(self, parent, id)
customer_id = 5675768556
text = "Customer ID: %10d" % customer_id
self.quote = wxStaticText(self, -1, text,wxPoint(20, 30))
# Enter Data
self.lblname1 = wxStaticText(self, -1, "First name
:",wxPoint(20,60))
self.edit1 = wxTextCtrl(self, 20, "", wxPoint(170, 60),
wxSize(140,-1))
self.lblname2 = wxStaticText(self, -1, "Last name :",wxPoint(20,90))
self.edit2 = wxTextCtrl(self, 20, "", wxPoint(170, 90),
wxSize(140,-1))
sampleList = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'10']
self.lblname3 = wxStaticText(self, -1, "Years :", wxPoint(20, 150))
self.choice = wxChoice(self, 40, (170, 150), choices = sampleList)
EVT_CHOICE(self, 40, self.EvtChoice)
EVT_TEXT(self, 20,self.EvtText)
def EvtText(self, event):
self.logger.AppendText('EvtText: %s\n' % event.GetString())
self.logger.AppendText('edit1: %s\n' % self.edit1.GetString())
self.logger.AppendText('edit2: %s\n' % self.edit2.GetString())
def EvtChoice(self, event):
self.logger.AppendText('EvtCoice: %d\n' % self.choice.GetString())
app = wxPySimpleApp()
frame = wxFrame(None, -1, " Enter Data")
Preq_form(frame,-1)
frame.Show(1)
app.MainLoop()