]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed problem between the splash screen and tip dialog.
authorRobin Dunn <robin@alldunn.com>
Wed, 20 Mar 2002 20:48:16 +0000 (20:48 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 20 Mar 2002 20:48:16 +0000 (20:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Main.py

index b4bca26df9ac6f47998daf6c9d4b7e12fbcad920..4f4a52a1ec6c12f058466e453ce81e9f6900f099 100644 (file)
@@ -132,6 +132,7 @@ class wxPythonDemo(wxFrame):
 
 
         self.otherWin = None
 
 
         self.otherWin = None
+        self.showTip = true
         EVT_IDLE(self, self.OnIdle)
         EVT_CLOSE(self, self.OnCloseWindow)
         EVT_ICONIZE(self, self.OnIconfiy)
         EVT_IDLE(self, self.OnIdle)
         EVT_CLOSE(self, self.OnCloseWindow)
         EVT_ICONIZE(self, self.OnIconfiy)
@@ -413,6 +414,25 @@ class wxPythonDemo(wxFrame):
             self.window = self.otherWin
             self.otherWin = None
 
             self.window = self.otherWin
             self.otherWin = None
 
+        if self.showTip:
+            self.ShowTip()
+            self.showTip = false
+
+
+    #---------------------------------------------
+    def ShowTip(self):
+        try:
+            showTipText = open(opj("data/showTips")).read()
+            showTip, index = eval(showTipText)
+        except IOError:
+            showTip, index = (1, 0)
+        if showTip:
+            tp = wxCreateFileTipProvider(opj("data/tips.txt"), index)
+            showTip = wxShowTip(self, tp)
+            index = tp.GetCurrentTip()
+            open(opj("data/showTips"), "w").write(str( (showTip, index) ))
+
+
     #---------------------------------------------
     def OnDemoMenu(self, event):
         try:
     #---------------------------------------------
     def OnDemoMenu(self, event):
         try:
@@ -480,21 +500,7 @@ class MySplashScreen(wxSplashScreen):
     def OnClose(self, evt):
         frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
         frame.Show(true)
     def OnClose(self, evt):
         frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
         frame.Show(true)
-        self.ShowTip(frame)
-        self.Destroy()
-
-    def ShowTip(self, frame):
-        try:
-            showTipText = open(opj("data/showTips")).read()
-            showTip, index = eval(showTipText)
-        except IOError:
-            showTip, index = (1, 0)
-        if showTip:
-            tp = wxCreateFileTipProvider(opj("data/tips.txt"), index)
-            showTip = wxShowTip(frame, tp)
-            index = tp.GetCurrentTip()
-            open(opj("data/showTips"), "w").write(str( (showTip, index) ))
-
+        evt.Skip()  # Make sure the default handler runs too...
 
 
 class MyApp(wxApp):
 
 
 class MyApp(wxApp):
@@ -506,7 +512,6 @@ class MyApp(wxApp):
         wxInitAllImageHandlers()
         splash = MySplashScreen()
         splash.Show()
         wxInitAllImageHandlers()
         splash = MySplashScreen()
         splash.Show()
-        wxYield()
         return true
 
 
         return true