]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/pydocview/PyDocViewDemo.py
'[1219035] cleanup: miscellaneous' and minor source cleaning.
[wxWidgets.git] / wxPython / samples / pydocview / PyDocViewDemo.py
index dcd3c189a1cfff6c60f9069ba3364aad6b2e58a3..aa0d2f02b697422f7109fa6babd89c8b788d5e1b 100644 (file)
@@ -27,14 +27,15 @@ _ = wx.GetTranslation
 
 class TextEditorApplication(pydocview.DocApp):
 
 
 class TextEditorApplication(pydocview.DocApp):
 
-
+    SPLASH = "splash.png"
+    
     def OnInit(self):
         # Call the super - this is important!!!
         pydocview.DocApp.OnInit(self)
 
         # Show the splash dialog while everything is loading up
     def OnInit(self):
         # Call the super - this is important!!!
         pydocview.DocApp.OnInit(self)
 
         # Show the splash dialog while everything is loading up
-        if os.path.exists("splash.jpg"):
-            self.ShowSplash("splash.jpg")
+        if os.path.exists(TextEditorApplication.SPLASH):
+            self.ShowSplash(TextEditorApplication.SPLASH)
 
         # Set the name and the icon
         self.SetAppName(_("wxPython PyDocView Demo"))
 
         # Set the name and the icon
         self.SetAppName(_("wxPython PyDocView Demo"))
@@ -63,8 +64,8 @@ class TextEditorApplication(pydocview.DocApp):
         optionsService        = self.InstallService(pydocview.DocOptionsService(supportedModes=wx.lib.docview.DOC_MDI))
         windowMenuService     = self.InstallService(pydocview.WindowMenuService())
         filePropertiesService = self.InstallService(pydocview.FilePropertiesService())
         optionsService        = self.InstallService(pydocview.DocOptionsService(supportedModes=wx.lib.docview.DOC_MDI))
         windowMenuService     = self.InstallService(pydocview.WindowMenuService())
         filePropertiesService = self.InstallService(pydocview.FilePropertiesService())
-        if os.path.exists("splash.jpg"):
-            aboutService      = self.InstallService(pydocview.AboutService(image=wx.Image("splash.jpg")))
+        if os.path.exists(TextEditorApplication.SPLASH):
+            aboutService      = self.InstallService(pydocview.AboutService(image=wx.Image(TextEditorApplication.SPLASH)))
         else:
             aboutService      = self.InstallService(pydocview.AboutService())
             
         else:
             aboutService      = self.InstallService(pydocview.AboutService())
             
@@ -82,13 +83,15 @@ class TextEditorApplication(pydocview.DocApp):
             textTemplate.CreateDocument('', docview.DOC_NEW).OnNewDocument()
 
         # Close the splash dialog
             textTemplate.CreateDocument('', docview.DOC_NEW).OnNewDocument()
 
         # Close the splash dialog
-        if os.path.exists("splash.jpg"):
+        if os.path.exists(TextEditorApplication.SPLASH):
             self.CloseSplash()
         
         # Show the tips dialog
         if os.path.exists("tips.txt"):
             wx.CallAfter(self.ShowTip, wx.GetApp().GetTopWindow(), wx.CreateFileTipProvider("tips.txt", 0))
 
             self.CloseSplash()
         
         # Show the tips dialog
         if os.path.exists("tips.txt"):
             wx.CallAfter(self.ShowTip, wx.GetApp().GetTopWindow(), wx.CreateFileTipProvider("tips.txt", 0))
 
+        wx.UpdateUIEvent.SetUpdateInterval(400)  # Overhead of updating menus was too much.  Change to update every 400 milliseconds.
+
         # Tell the framework that everything is great
         return True
 
         # Tell the framework that everything is great
         return True