# HG changeset patch # User Edouard Tisserant # Date 1519043097 -3600 # Node ID 7c2cd9d33070d745c2da018133aeee6eef4ea12a # Parent 95fa4e05e30f2ca92d8d88a86ee3b6a17665b43d Hook Beremiz Launcher AppStart to AdvancedSplash OnPaint event in order to ensure image is beeing displayed before loading. diff -r 95fa4e05e30f -r 7c2cd9d33070 Beremiz.py --- a/Beremiz.py Sun Feb 18 22:29:35 2018 +0100 +++ b/Beremiz.py Mon Feb 19 13:24:57 2018 +0100 @@ -52,11 +52,6 @@ def Bpath(self, *args): return os.path.join(self.app_dir, *args) - def ShowSplashScreen(self): - bmp = wx.Image(self.splashPath).ConvertToBitmap() - self.splash = AdvancedSplash(None, bitmap=bmp, agwStyle=AS_NOTIMEOUT | AS_CENTER_ON_SCREEN) - - def Usage(self): print("Usage:") print("%s [Options] [Projectpath] [Buildpath]" % sys.argv[0]) @@ -110,7 +105,6 @@ class BeremizApp(BeremizAppType): def OnInit(_self): self.ShowSplashScreen() - wx.CallAfter(self.AppStart) return True self.app = BeremizApp(redirect=self.debug) @@ -118,6 +112,17 @@ if wx.VERSION < (3, 0, 0): wx.InitAllImageHandlers() + def ShowSplashScreen(self): + class Splash(AdvancedSplash): + def OnPaint(_self, event): + AdvancedSplash.OnPaint(_self, event) + wx.CallAfter(self.AppStart) + bmp = wx.Image(self.splashPath).ConvertToBitmap() + self.splash = Splash(None, + bitmap=bmp, + agwStyle=AS_NOTIMEOUT | AS_CENTER_ON_SCREEN) + + def BackgroundInitialization(self): self.InitI18n() self.CheckUpdates()