I have a wx application which I just added a splash screen to, the problem is that sometimes (about 10% of the time) the splash screen frame pops up but is blank. I wrote the following test, which replicates the problem (below). The wx.Yield() helped somewhat, as the fail rate was more like 50% without it. Does anyone know how to fix this?
import wx
SLEEP_TIME = 1.0 # seconds
if __name__ == '__main__':
app = wx.App()
splash_image = wx.Image('spikepy_splash.bmp').ConvertToBitmap()
splash_screen = wx.SplashScreen(splash_image,
wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_NO_TIMEOUT, 0, None)
wx.Yield()
#wx.SafeYield()
#wx.GetApp().Yield()
wx.Sleep(SLEEP_TIME)