Fixed bug that was creating many frames at starup on Windows
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Thu, 29 Mar 2018 23:25:26 +0200
changeset 1976 5d72971a36a3
parent 1975 6b357f1e3134
child 1977 9b3655ed2e24
Fixed bug that was creating many frames at starup on Windows
Beremiz.py
--- a/Beremiz.py	Sun Mar 25 16:22:36 2018 +0200
+++ b/Beremiz.py	Thu Mar 29 23:25:26 2018 +0200
@@ -116,9 +116,12 @@
 
     def ShowSplashScreen(self):
         class Splash(AdvancedSplash):
+            Painted = False
             def OnPaint(_self, event):  # pylint: disable=no-self-argument
                 AdvancedSplash.OnPaint(_self, event)
-                wx.CallAfter(self.AppStart)
+                if not _self.Painted:  # trigger app start only once
+                    _self.Painted = True
+                    wx.CallAfter(self.AppStart)
         bmp = wx.Image(self.splashPath).ConvertToBitmap()
         self.splash = Splash(None,
                              bitmap=bmp,