Beremiz.py
changeset 1489 9c22ff9c8c06
parent 1483 004f9c52f7d8
child 1490 f03bc6c9c146
--- a/Beremiz.py	Wed Apr 20 16:20:53 2016 +0300
+++ b/Beremiz.py	Wed Apr 20 17:15:35 2016 +0300
@@ -43,6 +43,18 @@
 def Bpath(*args):
     return os.path.join(beremiz_dir,*args)
 
+def ShowSplashScreen():
+    bmp = wx.Image(Bpath("images", "splash.png")).ConvertToBitmap()
+    #splash=AdvancedSplash(None, bitmap=bmp, style=wx.SPLASH_CENTRE_ON_SCREEN, timeout=4000)
+    splash = AdvancedSplash(None, bitmap=bmp)
+
+    # process all events
+    # even the events generated by splash themself during showing
+    for i in range(0,30):
+        wx.Yield()
+        time.sleep(0.01);
+    return splash
+
 if __name__ == '__main__':
     def usage():
         print "\nUsage of Beremiz.py :"
@@ -94,11 +106,8 @@
 	wx.InitAllImageHandlers()
 
     # popup splash
-    bmp = wx.Image(Bpath("images", "splash.png")).ConvertToBitmap()
-    #splash=AdvancedSplash(None, bitmap=bmp, style=wx.SPLASH_CENTRE_ON_SCREEN, timeout=4000)
-    splash=AdvancedSplash(None, bitmap=bmp)
-    wx.Yield()
-
+    splash = ShowSplashScreen()
+    
     if updateinfo_url is not None:
         updateinfo = "Fetching %s" % updateinfo_url
         # warn for possible updates