The title explains most of it. at the point in the code where this frame gets created it immediately opens, closes, then segfaults, and the whole program dies. the program worked find before this frame was added and the only code using this frame from outside of it is the constructor.
It prints "done" and then dies.
emailDiag=EnterEmail(self,-1,'email win')
help would be greatly appreciated
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))
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)
panel1=wx.Panel(self,-1)
hsizer=wx.BoxSizer(wx.HORIZONTAL)
vsizer=wx.BoxSizer(wx.VERTICAL)
vsizer2=wx.BoxSizer(wx.VERTICAL)
infoLabel = wx.StaticText(self, -1, "Enter your phone and/or email information.")
infoLabel.SetFont(font3)
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)
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(self, -1,"Send",size=(150,30))
self.Bind(wx.EVT_BUTTON, self.OnSubmit, self.sendButton)
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):
pass
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()