X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c75a4cf0f94cbe53bfde4fbcddff741158fbc7c..82463c7d9292351fe306c66af77ef5fb8c1897de:/wxPython/demo/Main.py

diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py
index a2084d2967..c951870a3b 100644
--- a/wxPython/demo/Main.py
+++ b/wxPython/demo/Main.py
@@ -937,7 +937,7 @@ class DemoErrorPanel(wx.Panel):
         self.box = wx.BoxSizer(wx.VERTICAL)
 
         # Main Label
-        self.box.Add(wx.StaticText(self, -1, "An error has occured while trying to run the demo")
+        self.box.Add(wx.StaticText(self, -1, "An error has occurred while trying to run the demo")
                      , 0, wx.ALIGN_CENTER | wx.TOP, 10)
 
         # Exception Information
@@ -1404,7 +1404,7 @@ class wxPythonDemo(wx.Frame):
         
         # o The RunTest() for all samples must now return a window that can
         #   be palced in a tab in the main notebook.
-        # o If an error occurs (or has occured before) an error tab is created.
+        # o If an error occurs (or has occurred before) an error tab is created.
         
         if module is not None:
             wx.LogMessage("Running demo module...")
@@ -1679,16 +1679,27 @@ class MySplashScreen(wx.SplashScreen):
                                  wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
                                  5000, None, -1)
         self.Bind(wx.EVT_CLOSE, self.OnClose)
-        wx.FutureCall(2000, self.ShowMain)
+        self.fc = wx.FutureCall(2000, self.ShowMain)
+
 
     def OnClose(self, evt):
+        # Make sure the default handler runs too so this window gets
+        # destroyed
+        evt.Skip()
         self.Hide()
-        evt.Skip()  # Make sure the default handler runs too...
+        
+        # if the timer is still running then go ahead and show the
+        # main frame now
+        if self.fc.IsRunning():
+            self.fc.Stop()
+            self.ShowMain()
+
 
     def ShowMain(self):
         frame = wxPythonDemo(None, "wxPython: (A Demonstration)")
         frame.Show()
-        self.Raise()
+        if self.fc.IsRunning():
+            self.Raise()
         
 
 class MyApp(wx.App):