You are coding the button callback incorrectly. When you produce 102 lines of code with no testing, it is very difficult to find which line is segfaulting amongst all that code. Apparently no one else wanted to sift through all of this either. For starters, break this up using functions so you can test each function individually. The variables "RESOLUTION" and "CARRIERS" have not been declared in this class, so you will get an error. Note that the following program runs, but obviously still requires some work.
import wx
class EnterEmail(wx.Frame):
def __init__(self, parent,id,title):
## wx.Frame.__init__(self,parent,id,title,size=(RESOLUTION[0]/1.5,RESOLUTION[1]/1.5))
wx.Frame.__init__(self,parent,id,title)
self.parent=parent
font5 = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL)
font3 = wx.Font(18, wx.SWISS, wx.NORMAL, wx.NORMAL)
font1 = wx.Font(24, wx.SWISS, wx.NORMAL, wx.BOLD,True)
self.SetBackgroundColour('#f2f200')
sizer=wx.BoxSizer(wx.VERTICAL)
panel0=wx.Panel(self,-1)
infoLabel = wx.StaticText(panel0, -1, "Enter your phone and/or email information.")
infoLabel.SetFont(font3)
"""
panel1=wx.Panel(self,-1)
hsizer=wx.BoxSizer(wx.HORIZONTAL)
vsizer=wx.BoxSizer(wx.VERTICAL)
vsizer2=wx.BoxSizer(wx.VERTICAL)
emailLabel=wx.StaticText(self,-1,"Email")
emailLabel.SetFont(font1)
emailBoxLabel=wx.StaticText(self,-1,"Enter your e-mail address:")
emailBoxLabel.SetFont(font5)
self.email = wx.TextCtrl(self, -1, size=(300, 30))
self.email.SetFont(font3)
emailBoxLabel2=wx.StaticText(self,-1,"Confirm e-mail address:")
emailBoxLabel2.SetFont(font5)
self.confirmEmail = wx.TextCtrl(self, -1, size=(300, 30))
self.confirmEmail.SetFont(font3)
phoneLabel=wx.StaticText(self,-1,"Phone")
phoneLabel.SetFont(font1)
carrierLabel=wx.StaticText(self,-1,"Please select your service provider:")
carrierLabel.SetFont(font5)
self.carrierChoice=wx.Choice(self,-1,size=(300,30))
self.carrierChoice.SetFont(font3)
CARRIERS = ["abc", "def", "hij"]
self.carrierChoice.AppendItems(strings=CARRIERS)
numberLabel=wx.StaticText(self,-1,"Enter your phone number:")
numberLabel.SetFont(font5)
self.number= wx.TextCtrl(self, -1, size=(300, 30))
self.number.SetFont(font3)
"""
self.sendButton=wx.Button(panel0, -1,"Send", (30,30))
self.sendButton.Bind(wx.EVT_BUTTON, self.OnSubmit)
"""
self.startOverBut=wx.Button(self,-1,"Cancel",size=(150,30))
self.Bind(wx.EVT_BUTTON,self.OnClose,self.startOverBut)
#hooking it all together
vsizer.Add(emailLabel,0,wx.TOP|wx.ALIGN_CENTER,5)
vsizer.Add(emailBoxLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
vsizer.Add(self.email,0,wx.TOP|wx.ALIGN_CENTER,10)
vsizer.Add(emailBoxLabel2,0,wx.TOP|wx.ALIGN_CENTER,25)
vsizer.Add(self.confirmEmail,0,wx.TOP|wx.ALIGN_CENTER,10)
vsizer2.Add(phoneLabel,0,wx.TOP|wx.ALIGN_CENTER,5)
vsizer2.Add(carrierLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
vsizer2.Add(self.carrierChoice,0,wx.TOP|wx.ALIGN_CENTER,10)
vsizer2.Add(numberLabel,0,wx.TOP|wx.ALIGN_CENTER,25)
vsizer2.Add(self.number,0,wx.TOP|wx.ALIGN_CENTER,10)
vsizer.Add(self.startOverBut,0,wx.TOP|wx.EXPAND,25)
vsizer2.Add(self.sendButton,0,wx.TOP|wx.EXPAND,25)
sizer.Add(infoLabel, 0, wx.TOP|wx.ALIGN_CENTER, 5)
panel0.SetSizer(vsizer)
panel1.SetSizer(vsizer2)
hsizer.Add(vsizer,0,wx.LEFT|wx.ALIGN_LEFT,5)
hsizer.Add(vsizer2,0,wx.LEFT|wx.ALIGN_RIGHT,5)
sizer.Add(hsizer)
self.SetSizer(sizer)
self.Centre()
self.Bind(wx.EVT_TIMER, self.OnUpdateTimer)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow())
"""
self.Show(True)
print 'done '
def OnSubmit(self,event):
print "OnSubmit called"
def OnUpdateTimer(self,evt):
pass
def OnClose(self):
#### self.email.Destroy()
#### self.confirmEmail.Destroy()
#### self.carrierChoice.Destroy()
#### self.number.Destroy()
#### self.sendButton.Destroy()
#### self.startOverBut.Destroy()
self.Close(True)
def OnCloseWindow(self):
self.Destroy()
app = wx.App()
EM = EnterEmail(None, -1, 'EMail Test')
app. MainLoop()