0

I've used the sample code from the wiki but it just doesn't work for me, I see nothing. What am I doing wrong?

import wx

app = wx.App()

aBitmap = wx.Image(name = "wxPyWiki.jpg").ConvertToBitmap()
splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
splashDuration = 1000

splash = wx.adv.SplashScreen(aBitmap, splashStyle,
                                 splashDuration, None)
splash.Show()
wx.Yield()
4

1 回答 1

0

注意 SplashScreen 不在 wxpython 2.8.12 中的 wx.adv 中(我正在使用它)

这有效(使用我自己的图像)

import wx

app = wx.App()
aBitmap = wx.Image(name = "zimages/gato.jpg").ConvertToBitmap()
splashStyle = wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT
splashDuration = 1000

splash = wx.SplashScreen(aBitmap, splashStyle,
                                 splashDuration, None)
splash.Show()
app.MainLoop()

唯一的区别是使用wx.Yieldvs app.MainLoop
我不确定Yieldwxpython 2.9 中的用途,但请注意wx.Yield()已弃用

于 2013-07-24T20:28:48.150 回答