【问题标题】:SplashScreen covers any MessageBoxes in wxPython?SplashScreen 涵盖 wxPython 中的所有 MessageBox 吗?
【发布时间】:2010-05-24 08:51:47
【问题描述】:

我的应用程序在后台加载时显示SplashScreen

不幸的是,如果在应用程序初始化期间出现任何错误,则会显示MessageBox - 但在启动画面之后。这可以防止用户看到该消息,也无法将其关闭(退出的唯一方法是通过任务管理器)。

:如果出现任何错误,有什么办法可以隐藏 SplashScreen,或者让 MessageBoxes 在其上方显示?

我在 Windows 上使用 wxPython 2.8.10.1 和 Python 2.6.5。

【问题讨论】:

    标签: wxpython wxwidgets messagebox splash-screen


    【解决方案1】:

    您可以尝试以下方法:

    import wx
    
    class MySplashScreen(wx.SplashScreen):
        # splash screen impl
        ...
    
    class MyApp(wx.App):
        def OnInit(self):
            self.splash = MySplashScreen()
            # rest of app initialisation
            ...
    
    app = MyApp()
    try:
        app.MainLoop()
    except:
        app.splash.Close()
    

    【讨论】:

      猜你喜欢
      • 2017-11-07
      • 2018-11-23
      • 2013-12-13
      • 2012-06-18
      • 2023-01-20
      • 2021-12-29
      • 2023-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多