As I wrote earlier, there is nothing to see other than the string
'segmentation fault'.
What I can provide are the two classes.
class PwSplashScreen(wx.SplashScreen):
def __init__(self):
bmp =
wx.Image(opj(os.path.abspath(os.path.join(os.path.split(__file__)[0],"bitmaps","splash.png")))).ConvertToBitmap()
wx.SplashScreen.__init__(self, bmp,
wx.SPLASH_CENTER_ON_SCREEN|wx.SPLASH_TIMEOUT, 3000, None, -1)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.fc = wx.FutureCall(4000, self.ShowLogin)
def OnClose(self, evt):
# Make sure the default handler runs too so this window gets
# destroyed
evt.Skip()
self.Hide()
# if the timer is still running then go ahead and show the main
# frame now
if self.fc.IsRunning():
self.fc.Stop()
self.ShowLogin()
def ShowLogin(self):
dlg = LoginDialog()
dlg.ShowModal()
dlg.Destroy()
def ShowMain(self):
if self.fc.IsRunning():
self.Raise()
class LoginDialog(wx.Dialog):
def __init__(self, *args, **kwds):
super(LoginDialog, self).__init__(None)
topSizer = wx.BoxSizer(wx.VERTICAL)
header = wx.StaticText(self, -1, "PermitWatch Login")
topSizer.Add(header, 0, wx.ALIGN_CENTER|wx.ALL, 5)
unameBox = wx.BoxSizer(wx.HORIZONTAL)
lab = wx.StaticText(self, -1, "Username: ")
unameBox.Add(lab, 0, wx.ALIGN_CENTER|wx.ALL, 5)
self.unameTxt = wx.TextCtrl(self, -1, "", size=(150,-1),style=wx.TAB_TRAVERSAL|
wx.TE_PROCESS_ENTER|wx.RAISED_BORDER )
self.unameTxt.SetHelpText("Username is case sensitive.")
unameBox.Add(self.unameTxt, 1, wx.ALIGN_CENTER|wx.ALL, 5)
topSizer.Add(unameBox, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
pwBox = wx.BoxSizer(wx.HORIZONTAL)
lab = wx.StaticText(self, -1, "Password: ")
pwBox.Add(lab, 0, wx.ALIGN_CENTER|wx.ALL, 5)
self.pwTxt = wx.TextCtrl(self, -1, "", size=(150,-1), style=wx.TE_PASSWORD|
wx.TAB_TRAVERSAL|wx.TE_PROCESS_ENTER|wx.RAISED_BORDER)
self.pwTxt.SetHelpText("Password is case sensitive and must be longer than 6 characters.")
pwBox.Add(self.pwTxt, 0, wx.ALIGN_CENTER|wx.ALL, 5)
topSizer.Add(pwBox, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
btnSizer = wx.StdDialogButtonSizer()
OkBtn = wx.Button(self, wx.ID_OK)
OkBtn.SetHelpText("The OK button allows logging in.")
OkBtn.SetDefault()
btnSizer.AddButton(OkBtn)
self.Bind(wx.EVT_BUTTON, self.OnOK, OkBtn)
CancelBtn = wx.Button(self, wx.ID_CANCEL)
CancelBtn.SetHelpText("The Cancel button quits the application.")
btnSizer.AddButton(CancelBtn)
btnSizer.Realize()
self.Bind(wx.EVT_BUTTON, self.OnClose, CancelBtn)
topSizer.Add(btnSizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
self.SetSizer(topSizer)
topSizer.Fit(self)
def OnOK(self, event):
wx.MessageBox("You entered username %s and %s password." % (self.unameTxt.GetValue(), self.pwTxt.GetValue()))
# Add validity checking here.
self.Destroy()
def OnClose(self, event):
self.Destroy()
···
On Thu, 24 Jul 2014, Mike Stover wrote:
Would you mind posting the full seg fault / trace back?